mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[8.x] [Security Solution][Detection Engine] removes feature flag for logged requests for preview (#195569) (#195821)
# Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution][Detection Engine] removes feature flag for logged requests for preview (#195569)](https://github.com/elastic/kibana/pull/195569) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Vitalii Dmyterko","email":"92328789+vitaliidm@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-10T20:20:50Z","message":"[Security Solution][Detection Engine] removes feature flag for logged requests for preview (#195569)\n\n## Summary\r\n \r\n- removes feature flag for logged requests for preview","sha":"84d6899a4f2f97e0d015e733cc20064b43636154","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team: SecuritySolution","backport:prev-minor","Team:Detection Engine"],"title":"[Security Solution][Detection Engine] removes feature flag for logged requests for preview","number":195569,"url":"https://github.com/elastic/kibana/pull/195569","mergeCommit":{"message":"[Security Solution][Detection Engine] removes feature flag for logged requests for preview (#195569)\n\n## Summary\r\n \r\n- removes feature flag for logged requests for preview","sha":"84d6899a4f2f97e0d015e733cc20064b43636154"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/195569","number":195569,"mergeCommit":{"message":"[Security Solution][Detection Engine] removes feature flag for logged requests for preview (#195569)\n\n## Summary\r\n \r\n- removes feature flag for logged requests for preview","sha":"84d6899a4f2f97e0d015e733cc20064b43636154"}}]}] BACKPORT--> Co-authored-by: Vitalii Dmyterko <92328789+vitaliidm@users.noreply.github.com>
This commit is contained in:
parent
749217d6a5
commit
19509fda89
10 changed files with 3 additions and 44 deletions
|
@ -138,11 +138,6 @@ export const allowedExperimentalValues = Object.freeze({
|
|||
*/
|
||||
esqlRulesDisabled: false,
|
||||
|
||||
/**
|
||||
* enables logging requests during rule preview
|
||||
*/
|
||||
loggingRequestsEnabled: false,
|
||||
|
||||
/**
|
||||
* Enables Protection Updates tab in the Endpoint Policy Details page
|
||||
*/
|
||||
|
|
|
@ -23,7 +23,6 @@ import {
|
|||
stepDefineDefaultValue,
|
||||
} from '../../../../detections/pages/detection_engine/rules/utils';
|
||||
import { usePreviewInvocationCount } from './use_preview_invocation_count';
|
||||
import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features';
|
||||
|
||||
jest.mock('../../../../common/lib/kibana');
|
||||
jest.mock('./use_preview_route');
|
||||
|
@ -40,7 +39,6 @@ jest.mock('../../../../common/hooks/use_experimental_features', () => ({
|
|||
useIsExperimentalFeatureEnabled: jest.fn(),
|
||||
}));
|
||||
|
||||
const useIsExperimentalFeatureEnabledMock = useIsExperimentalFeatureEnabled as jest.Mock;
|
||||
// rule types that do not support logged requests
|
||||
const doNotSupportLoggedRequests: Type[] = [
|
||||
'threshold',
|
||||
|
@ -114,8 +112,6 @@ describe('PreviewQuery', () => {
|
|||
});
|
||||
|
||||
(usePreviewInvocationCount as jest.Mock).mockReturnValue({ invocationCount: 500 });
|
||||
|
||||
useIsExperimentalFeatureEnabledMock.mockReturnValue(true);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@ -172,23 +168,6 @@ describe('PreviewQuery', () => {
|
|||
});
|
||||
});
|
||||
|
||||
supportLoggedRequests.forEach((ruleType) => {
|
||||
test(`does not render "Show Elasticsearch requests" for ${ruleType} rule type when feature is disabled`, () => {
|
||||
useIsExperimentalFeatureEnabledMock.mockReturnValue(false);
|
||||
|
||||
render(
|
||||
<TestProviders>
|
||||
<RulePreview
|
||||
{...defaultProps}
|
||||
defineRuleData={{ ...defaultProps.defineRuleData, ruleType }}
|
||||
/>
|
||||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(screen.queryByTestId('show-elasticsearch-requests')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
doNotSupportLoggedRequests.forEach((ruleType) => {
|
||||
test(`does not render "Show Elasticsearch requests" for ${ruleType} rule type`, () => {
|
||||
render(
|
||||
|
|
|
@ -40,7 +40,6 @@ import type {
|
|||
TimeframePreviewOptions,
|
||||
} from '../../../../detections/pages/detection_engine/rules/types';
|
||||
import { usePreviewInvocationCount } from './use_preview_invocation_count';
|
||||
import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features';
|
||||
|
||||
export const REASONABLE_INVOCATION_COUNT = 200;
|
||||
|
||||
|
@ -90,8 +89,6 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
|
|||
const { indexPattern, ruleType } = defineRuleData;
|
||||
const { spaces } = useKibana().services;
|
||||
|
||||
const isLoggingRequestsFeatureEnabled = useIsExperimentalFeatureEnabled('loggingRequestsEnabled');
|
||||
|
||||
const [spaceId, setSpaceId] = useState('');
|
||||
useEffect(() => {
|
||||
if (spaces) {
|
||||
|
@ -282,8 +279,7 @@ const RulePreviewComponent: React.FC<RulePreviewProps> = ({
|
|||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFormRow>
|
||||
{isLoggingRequestsFeatureEnabled &&
|
||||
RULE_TYPES_SUPPORTING_LOGGED_REQUESTS.includes(ruleType) ? (
|
||||
{RULE_TYPES_SUPPORTING_LOGGED_REQUESTS.includes(ruleType) ? (
|
||||
<EuiFormRow>
|
||||
<EuiFlexGroup alignItems="center" gutterSize="s" responsive>
|
||||
<EuiFlexItem grow>
|
||||
|
|
|
@ -82,7 +82,6 @@ export function createTestConfig(options: CreateTestConfigOptions, testFiles?: s
|
|||
'--xpack.ruleRegistry.unsafe.legacyMultiTenancy.enabled=true',
|
||||
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
|
||||
'previewTelemetryUrlEnabled',
|
||||
'loggingRequestsEnabled',
|
||||
'riskScoringPersistence',
|
||||
'riskScoringRoutesEnabled',
|
||||
])}`,
|
||||
|
|
|
@ -17,6 +17,5 @@ export default createTestConfig({
|
|||
'testing_ignored.constant',
|
||||
'/testing_regex*/',
|
||||
])}`, // See tests within the file "ignore_fields.ts" which use these values in "alertIgnoreFields"
|
||||
`--xpack.securitySolution.enableExperimental=${JSON.stringify(['loggingRequestsEnabled'])}`,
|
||||
],
|
||||
});
|
||||
|
|
|
@ -1190,8 +1190,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
});
|
||||
});
|
||||
|
||||
// skipped on MKI since feature flags are not supported there
|
||||
describe('@skipInServerlessMKI preview logged requests', () => {
|
||||
describe('preview logged requests', () => {
|
||||
it('should not return requests property when not enabled', async () => {
|
||||
const { logs } = await previewRule({
|
||||
supertest,
|
||||
|
|
|
@ -1409,8 +1409,7 @@ export default ({ getService }: FtrProviderContext) => {
|
|||
});
|
||||
});
|
||||
|
||||
// skipped on MKI since feature flags are not supported there
|
||||
describe('@skipInServerlessMKI preview logged requests', () => {
|
||||
describe('preview logged requests', () => {
|
||||
let rule: EsqlRuleCreateProps;
|
||||
let id: string;
|
||||
beforeEach(async () => {
|
||||
|
|
|
@ -44,7 +44,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|||
// See https://github.com/elastic/kibana/pull/125396 for details
|
||||
'--xpack.alerting.rules.minimumScheduleInterval.value=1s',
|
||||
'--xpack.ruleRegistry.unsafe.legacyMultiTenancy.enabled=true',
|
||||
`--xpack.securitySolution.enableExperimental=${JSON.stringify(['loggingRequestsEnabled'])}`,
|
||||
// mock cloud to enable the guided onboarding tour in e2e tests
|
||||
'--xpack.cloud.id=test',
|
||||
`--home.disableWelcomeScreen=true`,
|
||||
|
|
|
@ -33,11 +33,6 @@ describe(
|
|||
'Detection rules, preview',
|
||||
{
|
||||
tags: ['@ess', '@serverless'],
|
||||
env: {
|
||||
kbnServerArgs: [
|
||||
`--xpack.securitySolution.enableExperimental=${JSON.stringify(['loggingRequestsEnabled'])}`,
|
||||
],
|
||||
},
|
||||
},
|
||||
() => {
|
||||
beforeEach(() => {
|
||||
|
|
|
@ -34,7 +34,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
|
|||
{ product_line: 'endpoint', product_tier: 'complete' },
|
||||
{ product_line: 'cloud', product_tier: 'complete' },
|
||||
])}`,
|
||||
`--xpack.securitySolution.enableExperimental=${JSON.stringify(['loggingRequestsEnabled'])}`,
|
||||
'--csp.strict=false',
|
||||
'--csp.warnLegacyBrowsers=false',
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue