Skip to content

Commit

Permalink
[Security Solution] Remove legacy navigation and related logic (#158094)
Browse files Browse the repository at this point in the history
part of: #157847
closes: #145718

### Background

The new navigation became the default navigation for Security on 8.4. To
have a smooth transition we added an advanced setting to use the old
navigation.

Since then the legacy navigation has become outdated, there are links in
Security that are not accessible through it, such as the landing pages
for the sub-sections:
- `/security/dashboards`
- `/security/explore`
- `/security/manage`

With the introduction of the new Security AI design, more of those
landing pages that are not compatible with the legacy navigation design
will be added (e.g. Rules). And it was starting to become overcrowded
since there was no possibility to collapse groups.

Also, over time it has become harder and harder to maintain both
versions at the same time, all the new pages added to security were
having to duplicate the navigation configurations for both versions and
also test everything twice.

On top of that, the legacy navigation won't be supported on the Security
Serverless projects, everything will work with the new one exclusively.

## Docs

The Security documentation assumes the new navigation is used
everywhere, there's no mention of the old navigation, only one small
section about the advanced setting (which is actually outdated):

https://www.elastic.co/guide/en/security/8.7/advanced-settings.html#_enable_grouped_navigation
Which will need to be removed for 8.9.

## Summary

Cleans the old navigation and the advanced setting
(`securitySolution:enableGroupedNav`) to turn it on. Removes the
telemetry (which shows almost no usage of it) and external dependencies
as well.

Only the new navigation will be available. 
All links should work only with the `app_links` architecture from now
on.

Old Nav ❌ 


![old_nav](https://github.com/elastic/kibana/assets/17747913/b95ff48c-73d4-45f6-93e5-8bec3fb24052)


New nav ✅ 


![new_nav](https://github.com/elastic/kibana/assets/17747913/8695c63e-df97-4ffc-b504-b4f48a366b3b)

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
semd and kibanamachine authored May 31, 2023
1 parent 3e3419d commit 6fd386c
Show file tree
Hide file tree
Showing 65 changed files with 799 additions and 4,185 deletions.
501 changes: 0 additions & 501 deletions x-pack/packages/security-solution/data_table/common/constants.ts

This file was deleted.

13 changes: 12 additions & 1 deletion x-pack/packages/security-solution/data_table/mock/mock_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@

import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { BrowserFields } from '@kbn/timelines-plugin/common';
import { DEFAULT_INDEX_PATTERN } from '../common/constants';

const DEFAULT_INDEX_PATTERN = [
'apm-*-transaction*',
'auditbeat-*',
'endgame-*',
'filebeat-*',
'logs-*',
'packetbeat-*',
'traces-apm*',
'winlogbeat-*',
'-*elastic-cloud-logs-*',
];

export const mockBrowserFields: BrowserFields = {
agent: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { cloudDefendPages } from './constants';
import { getSecuritySolutionLink, getSecuritySolutionNavTab } from './security_solution_links';
import { getSecuritySolutionLink } from './security_solution_links';
import { Chance } from 'chance';
import type { CloudDefendPage } from './types';

Expand All @@ -23,17 +23,3 @@ describe('getSecuritySolutionLink', () => {
expect(link.title).toEqual(cloudDefendPages[cloudDefendPage].name);
});
});

describe('getSecuritySolutionNavTab', () => {
it('gets the correct nav tab properties', () => {
const cloudDefendPage = chance.pickone<CloudDefendPage>(['policies']);
const basePath = chance.word();

const navTab = getSecuritySolutionNavTab(cloudDefendPage, basePath);

expect(navTab.id).toEqual(cloudDefendPages[cloudDefendPage].id);
expect(navTab.name).toEqual(cloudDefendPages[cloudDefendPage].name);
expect(navTab.href).toEqual(`${basePath}${cloudDefendPages[cloudDefendPage].path}`);
expect(navTab.disabled).toEqual(!!cloudDefendPages[cloudDefendPage].disabled);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ interface CloudDefendLinkItem<TId extends string = CloudDefendPageId> {
path: string;
}

interface CloudDefendNavTab<TId extends string = CloudDefendPageId> {
id: TId;
name: string;
href: string;
disabled: boolean;
}

/**
* Gets the cloud_defend link properties of a Cloud Defend page for navigation in the security solution.
* @param cloudDefendPage the name of the cloud defend page.
Expand All @@ -34,18 +27,3 @@ export const getSecuritySolutionLink = <TId extends string = CloudDefendPageId>(
path: cloudDefendPages[cloudDefendPage].path,
};
};

/**
* Gets the link properties of a Cloud Defend page for navigation in the old security solution navigation.
* @param cloudDefendPage the name of the cloud defend page.
* @param basePath the base path for links.
*/
export const getSecuritySolutionNavTab = <TId extends string = CloudDefendPageId>(
cloudDefendPage: CloudDefendPage,
basePath: string
): CloudDefendNavTab<TId> => ({
id: cloudDefendPages[cloudDefendPage].id as TId,
name: cloudDefendPages[cloudDefendPage].name,
href: `${basePath}${cloudDefendPages[cloudDefendPage].path}`,
disabled: !!cloudDefendPages[cloudDefendPage].disabled,
});
5 changes: 1 addition & 4 deletions x-pack/plugins/cloud_defend/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import { CloudDefendPlugin } from './plugin';

export type { CloudDefendSecuritySolutionContext } from './types';
export {
getSecuritySolutionLink,
getSecuritySolutionNavTab,
} from './common/navigation/security_solution_links';
export { getSecuritySolutionLink } from './common/navigation/security_solution_links';
export { CLOUD_DEFEND_BASE_PATH } from './common/navigation/constants';
export type { CloudDefendPageId } from './common/navigation/types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { cloudPosturePages } from './constants';
import { getSecuritySolutionLink, getSecuritySolutionNavTab } from './security_solution_links';
import { getSecuritySolutionLink } from './security_solution_links';
import { Chance } from 'chance';
import type { CspPage } from './types';

Expand All @@ -28,22 +28,3 @@ describe('getSecuritySolutionLink', () => {
expect(link.title).toEqual(cloudPosturePages[cspPage].name);
});
});

describe('getSecuritySolutionNavTab', () => {
it('gets the correct nav tab properties', () => {
const cspPage = chance.pickone<CspPage>([
'dashboard',
'findings',
'benchmarks',
'vulnerability_dashboard',
]);
const basePath = chance.word();

const navTab = getSecuritySolutionNavTab(cspPage, basePath);

expect(navTab.id).toEqual(cloudPosturePages[cspPage].id);
expect(navTab.name).toEqual(cloudPosturePages[cspPage].name);
expect(navTab.href).toEqual(`${basePath}${cloudPosturePages[cspPage].path}`);
expect(navTab.disabled).toEqual(!!cloudPosturePages[cspPage].disabled);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ interface CloudSecurityPostureLinkItem<TId extends string = CloudSecurityPosture
path: string;
}

interface CloudSecurityPostureNavTab<TId extends string = CloudSecurityPosturePageId> {
id: TId;
name: string;
href: string;
disabled: boolean;
}

/**
* Gets the cloud security posture link properties of a CSP page for navigation in the security solution.
* @param cloudSecurityPosturePage the name of the cloud posture page.
Expand All @@ -32,18 +25,3 @@ export const getSecuritySolutionLink = <TId extends string = CloudSecurityPostur
title: cloudPosturePages[cloudSecurityPosturePage].name,
path: cloudPosturePages[cloudSecurityPosturePage].path,
});

/**
* Gets the cloud security posture link properties of a CSP page for navigation in the old security solution navigation.
* @param cloudSecurityPosturePage the name of the cloud posture page.
* @param basePath the base path for links.
*/
export const getSecuritySolutionNavTab = <TId extends string = CloudSecurityPosturePageId>(
cloudSecurityPosturePage: CspPage,
basePath: string
): CloudSecurityPostureNavTab<TId> => ({
id: cloudPosturePages[cloudSecurityPosturePage].id as TId,
name: cloudPosturePages[cloudSecurityPosturePage].name,
href: `${basePath}${cloudPosturePages[cloudSecurityPosturePage].path}`,
disabled: !!cloudPosturePages[cloudSecurityPosturePage].disabled,
});
5 changes: 1 addition & 4 deletions x-pack/plugins/cloud_security_posture/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import { CspPlugin } from './plugin';
export type { CspSecuritySolutionContext } from './types';
export { CLOUD_SECURITY_POSTURE_BASE_PATH } from './common/navigation/constants';
export type { CloudSecurityPosturePageId } from './common/navigation/types';
export {
getSecuritySolutionLink,
getSecuritySolutionNavTab,
} from './common/navigation/security_solution_links';
export { getSecuritySolutionLink } from './common/navigation/security_solution_links';

export type { CspClientPluginSetup, CspClientPluginStart } from './types';

Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ export const INCLUDE_INDEX_PATTERN = [
/** The comma-delimited list of Elasticsearch indices from which the SIEM app collects events, and the exclude index pattern */
export const DEFAULT_INDEX_PATTERN = [...INCLUDE_INDEX_PATTERN, ...EXCLUDE_ELASTIC_CLOUD_INDICES];

/** This Kibana Advanced Setting enables the grouped navigation in Security Solution */
export const ENABLE_GROUPED_NAVIGATION = 'securitySolution:enableGroupedNav' as const;

/** This Kibana Advanced Setting enables the `Security news` feed widget */
export const ENABLE_NEWS_FEED_SETTING = 'securitySolution:enableNewsFeed' as const;

Expand Down
195 changes: 0 additions & 195 deletions x-pack/plugins/security_solution/public/app/deep_links/index.test.ts

This file was deleted.

Loading

0 comments on commit 6fd386c

Please sign in to comment.