Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make risk engine feature flags default true #167778

Merged
merged 7 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -40,44 +36,5 @@ describe('RiskScoreEnableButton', () => {
'Enable'
);
});

it('Triggers the right installer', async () => {
render(
<TestProviders>
<RiskScoreEnableButton
refetch={mockRefetch}
riskScoreEntity={riskScoreEntity}
timerange={timerange}
/>
</TestProviders>
);

await act(async () => {
await userEvent.click(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`));
});

expect(installRiskScoreModule).toHaveBeenCalled();
});

it('Update button state while installing', async () => {
render(
<TestProviders>
<RiskScoreEnableButton
refetch={mockRefetch}
riskScoreEntity={riskScoreEntity}
timerange={timerange}
/>
</TestProviders>
);

userEvent.click(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`));

await waitFor(() => {
expect(screen.getByTestId(`enable_${riskScoreEntity}_risk_score`)).toHaveProperty(
'disabled',
true
);
});
});
});
});
2 changes: 0 additions & 2 deletions x-pack/test/detection_engine_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 0 additions & 2 deletions x-pack/test/security_solution_cypress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 0 additions & 4 deletions x-pack/test/security_solution_cypress/serverless_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down