Skip to content

Commit 46edfb1

Browse files
[Security Solution][Attacks/Alerts][Navigation] detections top level link (elastic#232578) (elastic#242384)
## Summary Epic: elastic#232342 Tickets: * elastic#232578 * elastic#232581 * elastic#237175 These changes introduce a navigation for the new Alerts/Attacks alignment work. Instead of having a root level "Alerts" navigation item we add a new "Detections" item that will be a container for the all alerts detections relevant pages. This new "Detections" navigation item will allow users to navigate to either the "Alerts" or the "Attacks" page. ### Key changes **URL paths**: * Alerts page: `/app/security/alerts` * Attacks page: `/app/security/attacks` * Links landing page: `/app/security/alert_detections`. > [!NOTE] > Since `detections` path has already been used in the past, we need to keep reserved for the back compatibility. Also, for the same reason, I did not change alerts page URL for the users to be able to use existing alert details URLs and to avoid redirection logic. **UPDATE**: Agreed that we gonna look into the possibility to reuse `detections` in the URL path before removing the FF elastic#242434 **Feature flag**: Instead of using experimental feature flag configs, I switched to a [FeatureFlag service](https://github.com/elastic/kibana/blob/main/src/core/packages/feature-flags/README.mdx). It is a core service and allows easy access to feature flags in various parts of the kibana - including navigation, without us bringing extra configs parsing/setup code into the plugins where we need to use it. Right now, the experimental feature configs are not available in the `security_solution_ess` plugin and we will need to setup experimental feature flags there in order to be able to show/hide navigation changes. Besides that, the FeatureFlag service allows dynamically evaluate FF - somthing we can use later if needed. ### Global navigation <img width="1830" height="1298" alt="Screenshot 2025-11-10 at 10 48 17" src="https://github.com/user-attachments/assets/68b83eea-4ea9-44a5-9d98-2513fbdabf36" /> ### v1 navigation <img width="1830" height="1298" alt="Screenshot 2025-11-10 at 10 48 26" src="https://github.com/user-attachments/assets/1ed488f2-3f66-47b3-8b62-bc96252173e0" /> ### v2 navigation <img width="1830" height="1298" alt="Screenshot 2025-11-10 at 10 48 43" src="https://github.com/user-attachments/assets/6ffbfd24-4de3-437b-8685-d1fa12adc125" /> ### Links landing page <img width="1830" height="1298" alt="Screenshot 2025-11-10 at 10 48 22" src="https://github.com/user-attachments/assets/07af9289-5aa0-4522-81f6-14382c084bb0" /> ### Empty "Attacks" page <img width="1830" height="1298" alt="Screenshot 2025-11-10 at 10 48 10" src="https://github.com/user-attachments/assets/25f3a14c-1e43-4c95-9540-067ca2afe116" /> ## Feature Flag > [!NOTE] > The feature is hidden behind the feature flag (in `kibana.dev.yml`): ``` feature_flags.overrides: securitySolution.attacksAlertsAlignment: true ``` --------- Co-authored-by: kibanamachine <[email protected]>
1 parent 6e9f563 commit 46edfb1

File tree

31 files changed

+966
-71
lines changed

31 files changed

+966
-71
lines changed

src/platform/packages/shared/deeplinks/security/deep_links.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@
1010
export enum SecurityPageName {
1111
administration = 'administration',
1212
alerts = 'alerts',
13+
attacks = 'attacks',
1314
aiValue = 'ai_value',
1415
assetInventory = 'asset_inventory',
1516
attackDiscovery = 'attack_discovery',
1617
blocklist = 'blocklist',
18+
19+
// TODO: https://github.com/elastic/kibana/issues/242434
20+
// Investigate possibility of using `detections` instead
21+
alertDetections = 'alert_detections',
22+
1723
/*
1824
* Warning: Computed values are not permitted in an enum with string valued members
1925
* All Cases page names must match `CasesDeepLinkId` in x-pack/platform/plugins/shared/cases/public/common/navigation/deep_links.ts

x-pack/solutions/security/packages/navigation/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ export {
1313
SecurityGroupName,
1414
LinkCategoryType,
1515
SECURITY_UI_APP_ID,
16+
ATTACKS_ALERTS_ALIGNMENT_ENABLED,
1617
} from './src/constants';
1718
export * from './src/types';

x-pack/solutions/security/packages/navigation/src/constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@ export enum SecurityGroupName {
3030
entityAnalytics = 'securityGroup:entityAnalytics',
3131
machineLearning = 'securityGroup:machineLearning',
3232
launchpad = 'securityGroup:launchpad',
33+
34+
// TODO: https://github.com/elastic/kibana/issues/242434
35+
// Investigate possibility of using `detections` instead
36+
alertDetections = 'securityGroup:alertDetections',
3337
}
38+
39+
/** Feature flag for the alerts and attacks alignment feature */
40+
export const ATTACKS_ALERTS_ALIGNMENT_ENABLED = 'securitySolution.attacksAlertsAlignment' as const;

x-pack/solutions/security/packages/navigation/src/i18n_strings.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
import { i18n } from '@kbn/i18n';
99

1010
export const i18nStrings = {
11+
alertDetections: {
12+
title: i18n.translate('securitySolutionPackages.navLinks.alertDetections', {
13+
defaultMessage: 'Detections',
14+
}),
15+
views: {
16+
title: i18n.translate('securitySolutionPackages.navLinks.rules.views', {
17+
defaultMessage: 'Views',
18+
}),
19+
},
20+
},
1121
rules: {
1222
title: i18n.translate('securitySolutionPackages.navLinks.rules', {
1323
defaultMessage: 'Rules',

x-pack/solutions/security/packages/navigation/src/link_groups.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export interface SecurityLinkGroupDefinition {
1414

1515
export const SecurityLinkGroup: Record<SecurityGroupName, SecurityLinkGroupDefinition> =
1616
Object.freeze({
17+
[SecurityGroupName.alertDetections]: { title: i18nStrings.alertDetections.title },
1718
[SecurityGroupName.rules]: { title: i18nStrings.rules.title },
1819
[SecurityGroupName.explore]: { title: i18nStrings.explore.title },
1920
[SecurityGroupName.investigations]: { title: i18nStrings.investigations.title },
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import type { NodeDefinition } from '@kbn/core-chrome-browser';
9+
import { SecurityPageName, SecurityGroupName } from '../constants';
10+
import { SecurityLinkGroup } from '../link_groups';
11+
import { securityLink } from '../links';
12+
import { i18nStrings } from '../i18n_strings';
13+
14+
export const createAlertDetectionsNavigationTree = (
15+
{ sideNavVersion }: { sideNavVersion?: NodeDefinition['sideNavVersion'] } = {
16+
sideNavVersion: 'v1',
17+
}
18+
): NodeDefinition => ({
19+
id: SecurityGroupName.alertDetections,
20+
title: SecurityLinkGroup[SecurityGroupName.alertDetections].title,
21+
iconV2: 'warning',
22+
renderAs: 'panelOpener',
23+
sideNavVersion,
24+
children: [
25+
{
26+
title: i18nStrings.alertDetections.views.title,
27+
breadcrumbStatus: 'hidden',
28+
children: [
29+
{
30+
id: SecurityPageName.attacks,
31+
link: securityLink(SecurityPageName.attacks),
32+
},
33+
{
34+
id: SecurityPageName.alerts,
35+
link: securityLink(SecurityPageName.alerts),
36+
},
37+
],
38+
},
39+
],
40+
});

x-pack/solutions/security/packages/navigation/src/navigation_tree/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ import { createAssetsNavigationTree } from './assets_navigation_tree';
1414
import { createEntityAnalyticsNavigationTree } from './entity_analytics_navigation_tree';
1515
import { createMachineLearningNavigationTree } from './ml_navigation_tree';
1616
import { createV2NavigationTree } from './v2_navigation_tree';
17+
import { createAlertDetectionsNavigationTree } from './alert_detections_navigation_tree';
1718

1819
export const defaultNavigationTree = {
20+
alertDetections: createAlertDetectionsNavigationTree,
1921
dashboards: createDashboardsNavigationTree,
2022
rules: createRulesNavigationTree,
2123
cases: createCasesNavigationTree,

x-pack/solutions/security/packages/navigation/src/navigation_tree/v2_navigation_tree.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { defaultNavigationTree } from '../../navigation_tree';
1111

1212
import { SecurityPageName } from '../..';
1313
import { i18nStrings, securityLink } from '../../links';
14+
import { ATTACKS_ALERTS_ALIGNMENT_ENABLED } from '../constants';
1415

1516
const LazyIconWorkflow = lazy(() =>
1617
import('./v2_icons/workflow').then(({ iconWorkflow }) => ({ default: iconWorkflow }))
@@ -34,12 +35,14 @@ export const createV2NavigationTree = (core: CoreStart): NodeDefinition[] => [
3435
},
3536
defaultNavigationTree.dashboards({ sideNavVersion: 'v2' }),
3637
defaultNavigationTree.rules({ sideNavVersion: 'v2' }),
37-
{
38-
id: SecurityPageName.alerts,
39-
iconV2: 'warning',
40-
link: securityLink(SecurityPageName.alerts),
41-
sideNavVersion: 'v2',
42-
},
38+
core.featureFlags.getBooleanValue(ATTACKS_ALERTS_ALIGNMENT_ENABLED, false)
39+
? defaultNavigationTree.alertDetections({ sideNavVersion: 'v2' })
40+
: {
41+
id: SecurityPageName.alerts,
42+
iconV2: 'warning',
43+
link: securityLink(SecurityPageName.alerts),
44+
sideNavVersion: 'v2',
45+
},
4346
{
4447
// TODO: update icon from EUI
4548
iconV2: LazyIconWorkflow,

x-pack/solutions/security/plugins/security_solution/common/constants.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import { RuleNotifyWhen } from '@kbn/alerting-plugin/common';
99
import type { FilterControlConfig } from '@kbn/alerts-ui-shared';
1010
import * as i18n from './translations';
1111

12-
export { SecurityPageName } from '@kbn/security-solution-navigation';
12+
export {
13+
SecurityPageName,
14+
ATTACKS_ALERTS_ALIGNMENT_ENABLED,
15+
} from '@kbn/security-solution-navigation';
1316
/**
1417
* as const
1518
*
@@ -97,7 +100,13 @@ export const REPORTS_PATH = '/reports' as const;
97100
export const AI_VALUE_PATH = `${REPORTS_PATH}/ai_value` as const;
98101
export const DETECTION_RESPONSE_PATH = '/detection_response' as const;
99102
export const DETECTIONS_PATH = '/detections' as const;
103+
104+
// TODO: https://github.com/elastic/kibana/issues/242434
105+
// Investigate possibility of using `detections` instead
100106
export const ALERTS_PATH = '/alerts' as const;
107+
export const ATTACKS_PATH = '/attacks' as const;
108+
export const ALERT_DETECTIONS = '/alert_detections' as const;
109+
101110
export const ALERT_DETAILS_REDIRECT_PATH = `${ALERTS_PATH}/redirect` as const;
102111
export const ALERT_SUMMARY_PATH = `/alert_summary` as const;
103112
export const RULES_PATH = '/rules' as const;

x-pack/solutions/security/plugins/security_solution/common/experimental_features.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ export const allowedExperimentalValues = Object.freeze({
175175
* Release: 9.2.0
176176
*/
177177
microsoftDefenderEndpointCancelEnabled: true,
178-
/**
179-
* Protects all the work related to the attacks and alerts alignment effort
180-
*/
181-
attacksAlertsAlignment: false,
182178
});
183179

184180
type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;

0 commit comments

Comments
 (0)