From 236eff476952d8b7d753d188fe0667688dac01d7 Mon Sep 17 00:00:00 2001 From: Khristinin Nikita Date: Mon, 2 Oct 2023 21:01:47 +0200 Subject: [PATCH] Make risk engine feature flags default true (#167778) ## Summary Enable feature flags true for risk engine --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../common/experimental_features.ts | 4 +- .../risk_score_enable_button.test.tsx | 45 +------------------ .../common/config.ts | 2 - .../check_registered_task_types.ts | 1 + .../test/security_solution_cypress/config.ts | 2 - .../serverless_config.ts | 4 -- 6 files changed, 4 insertions(+), 54 deletions(-) diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/plugins/security_solution/common/experimental_features.ts index 36c83167ee7fc..b92da8f442a07 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/plugins/security_solution/common/experimental_features.ts @@ -97,12 +97,12 @@ export const allowedExperimentalValues = Object.freeze({ /** * Enable risk engine client and initialisation of datastream, component templates and mappings */ - riskScoringPersistence: false, + riskScoringPersistence: true, /** * Enables experimental Entity Analytics HTTP endpoints */ - riskScoringRoutesEnabled: false, + riskScoringRoutesEnabled: true, /* * * Enables Discover embedded within timeline diff --git a/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_onboarding/risk_score_enable_button.test.tsx b/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_onboarding/risk_score_enable_button.test.tsx index 070b1df90fb6c..a92496316c3ce 100644 --- a/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_onboarding/risk_score_enable_button.test.tsx +++ b/x-pack/plugins/security_solution/public/explore/components/risk_score/risk_score_onboarding/risk_score_enable_button.test.tsx @@ -4,16 +4,12 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { act, render, screen, waitFor } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; +import { render, screen } from '@testing-library/react'; import React from 'react'; import { RiskScoreEntity } from '../../../../../common/search_strategy'; import { TestProviders } from '../../../../common/mock'; import { RiskScoreEnableButton } from './risk_score_enable_button'; -import { installRiskScoreModule } from './utils'; - -jest.mock('./utils'); describe('RiskScoreEnableButton', () => { const mockRefetch = jest.fn(); @@ -40,44 +36,5 @@ describe('RiskScoreEnableButton', () => { 'Enable' ); }); - - it('Triggers the right installer', async () => { - render( - - - - ); - - await act(async () => { - await userEvent.click(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`)); - }); - - expect(installRiskScoreModule).toHaveBeenCalled(); - }); - - it('Update button state while installing', async () => { - render( - - - - ); - - userEvent.click(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`)); - - await waitFor(() => { - expect(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`)).toHaveProperty( - 'disabled', - true - ); - }); - }); }); }); diff --git a/x-pack/test/detection_engine_api_integration/common/config.ts b/x-pack/test/detection_engine_api_integration/common/config.ts index c4c3c44f1c418..a1a71bf907b86 100644 --- a/x-pack/test/detection_engine_api_integration/common/config.ts +++ b/x-pack/test/detection_engine_api_integration/common/config.ts @@ -76,8 +76,6 @@ export function createTestConfig(options: CreateTestConfigOptions, testFiles?: s '--xpack.ruleRegistry.unsafe.legacyMultiTenancy.enabled=true', `--xpack.securitySolution.enableExperimental=${JSON.stringify([ 'previewTelemetryUrlEnabled', - 'riskScoringPersistence', - 'riskScoringRoutesEnabled', ])}`, '--xpack.task_manager.poll_interval=1000', `--xpack.actions.preconfigured=${JSON.stringify({ diff --git a/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts index 0fbe0e10922ec..17154d9a254c4 100644 --- a/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts +++ b/x-pack/test/plugin_api_integration/test_suites/task_manager/check_registered_task_types.ts @@ -140,6 +140,7 @@ export default function ({ getService }: FtrProviderContext) { 'osquery:telemetry-saved-queries', 'report:execute', 'reports:monitor', + 'risk_engine:risk_scoring', 'security:endpoint-diagnostics', 'security:endpoint-meta-telemetry', 'security:telemetry-configuration', diff --git a/x-pack/test/security_solution_cypress/config.ts b/x-pack/test/security_solution_cypress/config.ts index ece8ee522917c..21259c2d289e2 100644 --- a/x-pack/test/security_solution_cypress/config.ts +++ b/x-pack/test/security_solution_cypress/config.ts @@ -48,8 +48,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { 'alertDetailsPageEnabled', 'chartEmbeddablesEnabled', 'discoverInTimeline', - 'riskScoringRoutesEnabled', - 'riskScoringPersistence', ])}`, // mock cloud to enable the guided onboarding tour in e2e tests '--xpack.cloud.id=test', diff --git a/x-pack/test/security_solution_cypress/serverless_config.ts b/x-pack/test/security_solution_cypress/serverless_config.ts index 366e963d1b4eb..d0ee1613f6e4c 100644 --- a/x-pack/test/security_solution_cypress/serverless_config.ts +++ b/x-pack/test/security_solution_cypress/serverless_config.ts @@ -29,10 +29,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { ...svlSharedConfig.get('kbnTestServer.serverArgs'), '--serverless=security', '--xpack.encryptedSavedObjects.encryptionKey="abcdefghijklmnopqrstuvwxyz123456"', - `--xpack.securitySolution.enableExperimental=${JSON.stringify([ - 'riskScoringRoutesEnabled', - 'riskScoringPersistence', - ])}`, `--xpack.securitySolutionServerless.productTypes=${JSON.stringify([ { product_line: 'security', product_tier: 'complete' }, { product_line: 'endpoint', product_tier: 'complete' },