diff --git a/x-pack/plugins/security_solution/public/app/types.ts b/x-pack/plugins/security_solution/public/app/types.ts index d2b449d484089..a1314b27a0ab7 100644 --- a/x-pack/plugins/security_solution/public/app/types.ts +++ b/x-pack/plugins/security_solution/public/app/types.ts @@ -18,6 +18,7 @@ import type { import type { RouteProps } from 'react-router-dom'; import type { AppMountParameters } from '@kbn/core/public'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import type { ExploreReducer, ExploreState } from '../explore'; import type { StartServices } from '../types'; /** @@ -38,8 +39,8 @@ import type { TableState } from '../common/store/data_table/types'; export { SecurityPageName } from '../../common/constants'; export interface SecuritySubPluginStore { - initialState: Record; - reducer: Record>; + initialState: K extends 'explore' ? ExploreState : Record; + reducer: K extends 'explore' ? ExploreReducer : Record>; middleware?: Array>>>; } @@ -48,12 +49,15 @@ export type SecuritySubPluginRoutes = RouteProps[]; export interface SecuritySubPlugin { routes: SecuritySubPluginRoutes; storageDataTables?: Pick; + exploreDataTables?: { + network: Pick; + hosts: Pick; + users: Pick; + }; } export type SecuritySubPluginKeyStore = - | 'hosts' - | 'users' - | 'network' + | 'explore' | 'timeline' | 'hostList' | 'alertList' diff --git a/x-pack/plugins/security_solution/public/common/store/store.ts b/x-pack/plugins/security_solution/public/common/store/store.ts index af2797697f067..7a00dafedcd20 100644 --- a/x-pack/plugins/security_solution/public/common/store/store.ts +++ b/x-pack/plugins/security_solution/public/common/store/store.ts @@ -110,16 +110,14 @@ export const createStoreFactory = async ( const dataTableInitialState = { dataTable: { tableById: { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + /* eslint-disable @typescript-eslint/no-non-null-assertion */ ...subPlugins.alerts.storageDataTables!.tableById, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion ...subPlugins.rules.storageDataTables!.tableById, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion ...subPlugins.exceptions.storageDataTables!.tableById, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - ...subPlugins.hosts.storageDataTables!.tableById, - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - ...subPlugins.network.storageDataTables!.tableById, + ...subPlugins.explore.exploreDataTables!.hosts.tableById, + ...subPlugins.explore.exploreDataTables!.network.tableById, + ...subPlugins.explore.exploreDataTables!.users.tableById, + /* eslint-enable @typescript-eslint/no-non-null-assertion */ }, }, }; @@ -132,9 +130,7 @@ export const createStoreFactory = async ( const initialState = createInitialState( { - ...subPlugins.hosts.store.initialState, - ...subPlugins.users.store.initialState, - ...subPlugins.network.store.initialState, + ...subPlugins.explore.store.initialState, ...timelineInitialState, ...subPlugins.management.store.initialState, }, @@ -148,9 +144,7 @@ export const createStoreFactory = async ( ); const rootReducer = { - ...subPlugins.hosts.store.reducer, - ...subPlugins.users.store.reducer, - ...subPlugins.network.store.reducer, + ...subPlugins.explore.store.reducer, timeline: timelineReducer, ...subPlugins.management.store.reducer, }; diff --git a/x-pack/plugins/security_solution/public/explore/hosts/index.ts b/x-pack/plugins/security_solution/public/explore/hosts/index.ts deleted file mode 100644 index 06e61e8ace88c..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/hosts/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { Storage } from '@kbn/kibana-utils-plugin/public'; -import type { TableIdLiteral } from '../../../common/types'; -import { TableId } from '../../../common/types'; -import type { SecuritySubPluginWithStore } from '../../app/types'; -import { getDataTablesInStorageByIds } from '../../timelines/containers/local_storage'; -import { routes } from './routes'; -import type { HostsState } from './store'; -import { initialHostsState, hostsReducer } from './store'; - -const HOST_TABLE_IDS: TableIdLiteral[] = [TableId.hostsPageEvents, TableId.hostsPageSessions]; - -export class Hosts { - public setup() {} - - public start(storage: Storage): SecuritySubPluginWithStore<'hosts', HostsState> { - return { - routes, - storageDataTables: { - tableById: getDataTablesInStorageByIds(storage, HOST_TABLE_IDS), - }, - store: { - initialState: { hosts: initialHostsState }, - reducer: { hosts: hostsReducer }, - }, - }; - } -} diff --git a/x-pack/plugins/security_solution/public/explore/hosts/links.ts b/x-pack/plugins/security_solution/public/explore/hosts/links.ts deleted file mode 100644 index 5c7225b6da452..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/hosts/links.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { i18n } from '@kbn/i18n'; -import { HOSTS_PATH, SecurityPageName } from '../../../common/constants'; -import { HOSTS } from '../../app/translations'; -import type { LinkItem } from '../../common/links/types'; -import hostsPageImg from '../../common/images/hosts_page.png'; - -export const links: LinkItem = { - id: SecurityPageName.hosts, - title: HOSTS, - landingImage: hostsPageImg, - description: i18n.translate('xpack.securitySolution.landing.threatHunting.hostsDescription', { - defaultMessage: 'A comprehensive overview of all hosts and host-related security events.', - }), - path: HOSTS_PATH, - globalSearchKeywords: [ - i18n.translate('xpack.securitySolution.appLinks.hosts', { - defaultMessage: 'Hosts', - }), - ], - links: [ - { - id: SecurityPageName.uncommonProcesses, - title: i18n.translate('xpack.securitySolution.appLinks.hosts.uncommonProcesses', { - defaultMessage: 'Uncommon Processes', - }), - path: `${HOSTS_PATH}/uncommonProcesses`, - }, - { - id: SecurityPageName.hostsAnomalies, - title: i18n.translate('xpack.securitySolution.appLinks.hosts.anomalies', { - defaultMessage: 'Anomalies', - }), - path: `${HOSTS_PATH}/anomalies`, - licenseType: 'gold', - }, - { - id: SecurityPageName.hostsEvents, - title: i18n.translate('xpack.securitySolution.appLinks.hosts.events', { - defaultMessage: 'Events', - }), - path: `${HOSTS_PATH}/events`, - }, - { - id: SecurityPageName.hostsRisk, - title: i18n.translate('xpack.securitySolution.appLinks.hosts.risk', { - defaultMessage: 'Host risk', - }), - path: `${HOSTS_PATH}/hostRisk`, - }, - { - id: SecurityPageName.sessions, - title: i18n.translate('xpack.securitySolution.appLinks.hosts.sessions', { - defaultMessage: 'Sessions', - }), - path: `${HOSTS_PATH}/sessions`, - isBeta: false, - licenseType: 'enterprise', - }, - ], -}; diff --git a/x-pack/plugins/security_solution/public/explore/hosts/routes.tsx b/x-pack/plugins/security_solution/public/explore/hosts/routes.tsx deleted file mode 100644 index e062a4743be57..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/hosts/routes.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; -import { HostsContainer } from './pages'; -import type { SecuritySubPluginRoutes } from '../../app/types'; -import { SecurityPageName } from '../../app/types'; -import { HOSTS_PATH } from '../../../common/constants'; -import { PluginTemplateWrapper } from '../../common/components/plugin_template_wrapper'; - -export const HostsRoutes = () => ( - - - - - -); - -export const routes: SecuritySubPluginRoutes = [ - { - path: HOSTS_PATH, - component: HostsRoutes, - }, -]; diff --git a/x-pack/plugins/security_solution/public/explore/index.ts b/x-pack/plugins/security_solution/public/explore/index.ts new file mode 100644 index 0000000000000..2141cd45e0fcc --- /dev/null +++ b/x-pack/plugins/security_solution/public/explore/index.ts @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { Storage } from '@kbn/kibana-utils-plugin/public'; +import type { AnyAction, Reducer } from 'redux'; +import type { HostsState } from './hosts/store'; +import type { UsersState } from './users/store'; +import { TableId } from '../../common/types'; +import type { SecuritySubPluginWithStore } from '../app/types'; +import { routes } from './routes'; +import type { NetworkState } from './network/store'; +import { initialNetworkState, networkReducer } from './network/store'; +import { getDataTablesInStorageByIds } from '../timelines/containers/local_storage'; +import { initialUsersState, usersReducer } from './users/store'; +import { hostsReducer, initialHostsState } from './hosts/store'; + +export interface ExploreState { + network: NetworkState; + hosts: HostsState; + users: UsersState; +} + +export interface ExploreReducer { + network: Reducer; + hosts: Reducer; + users: Reducer; +} + +export class Explore { + public setup() {} + + public start(storage: Storage): SecuritySubPluginWithStore<'explore', ExploreState> { + return { + routes, + exploreDataTables: { + network: { tableById: getDataTablesInStorageByIds(storage, [TableId.networkPageEvents]) }, + hosts: { + tableById: getDataTablesInStorageByIds(storage, [ + TableId.hostsPageEvents, + TableId.hostsPageSessions, + ]), + }, + users: { + tableById: getDataTablesInStorageByIds(storage, [TableId.usersPageEvents]), + }, + }, + store: { + initialState: { + network: initialNetworkState, + users: initialUsersState, + hosts: initialHostsState, + }, + reducer: { network: networkReducer, users: usersReducer, hosts: hostsReducer }, + }, + }; + } +} diff --git a/x-pack/plugins/security_solution/public/explore/links.ts b/x-pack/plugins/security_solution/public/explore/links.ts new file mode 100644 index 0000000000000..f54262bf57151 --- /dev/null +++ b/x-pack/plugins/security_solution/public/explore/links.ts @@ -0,0 +1,172 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { HOSTS_PATH, NETWORK_PATH, SecurityPageName, USERS_PATH } from '../../common/constants'; +import { HOSTS, NETWORK, USERS } from '../app/translations'; +import type { LinkItem } from '../common/links/types'; +import hostsPageImg from '../common/images/hosts_page.png'; +import userPageImg from '../common/images/users_page.png'; +import networkPageImg from '../common/images/network_page.png'; + +const networkLinks: LinkItem = { + id: SecurityPageName.network, + title: NETWORK, + landingImage: networkPageImg, + description: i18n.translate('xpack.securitySolution.appLinks.network.description', { + defaultMessage: + 'Provides key activity metrics in an interactive map as well as event tables that enable interaction with the Timeline.', + }), + path: NETWORK_PATH, + globalSearchKeywords: [ + i18n.translate('xpack.securitySolution.appLinks.network', { + defaultMessage: 'Network', + }), + ], + links: [ + { + id: SecurityPageName.networkDns, + title: i18n.translate('xpack.securitySolution.appLinks.network.dns', { + defaultMessage: 'DNS', + }), + path: `${NETWORK_PATH}/dns`, + }, + { + id: SecurityPageName.networkHttp, + title: i18n.translate('xpack.securitySolution.appLinks.network.http', { + defaultMessage: 'HTTP', + }), + path: `${NETWORK_PATH}/http`, + }, + { + id: SecurityPageName.networkTls, + title: i18n.translate('xpack.securitySolution.appLinks.network.tls', { + defaultMessage: 'TLS', + }), + path: `${NETWORK_PATH}/tls`, + }, + { + id: SecurityPageName.networkAnomalies, + title: i18n.translate('xpack.securitySolution.appLinks.hosts.anomalies', { + defaultMessage: 'Anomalies', + }), + path: `${NETWORK_PATH}/anomalies`, + licenseType: 'gold', + }, + { + id: SecurityPageName.networkEvents, + title: i18n.translate('xpack.securitySolution.appLinks.network.events', { + defaultMessage: 'Events', + }), + path: `${NETWORK_PATH}/events`, + }, + ], +}; + +const usersLinks: LinkItem = { + id: SecurityPageName.users, + title: USERS, + landingImage: userPageImg, + description: i18n.translate('xpack.securitySolution.appLinks.users.description', { + defaultMessage: + 'A comprehensive overview of user data that enables understanding of authentication and user behavior within your environment.', + }), + path: USERS_PATH, + globalSearchKeywords: [ + i18n.translate('xpack.securitySolution.appLinks.users', { + defaultMessage: 'Users', + }), + ], + links: [ + { + id: SecurityPageName.usersAuthentications, + title: i18n.translate('xpack.securitySolution.appLinks.users.authentications', { + defaultMessage: 'Authentications', + }), + path: `${USERS_PATH}/authentications`, + }, + { + id: SecurityPageName.usersAnomalies, + title: i18n.translate('xpack.securitySolution.appLinks.users.anomalies', { + defaultMessage: 'Anomalies', + }), + path: `${USERS_PATH}/anomalies`, + licenseType: 'gold', + }, + { + id: SecurityPageName.usersRisk, + title: i18n.translate('xpack.securitySolution.appLinks.users.risk', { + defaultMessage: 'User risk', + }), + path: `${USERS_PATH}/userRisk`, + }, + { + id: SecurityPageName.usersEvents, + title: i18n.translate('xpack.securitySolution.appLinks.users.events', { + defaultMessage: 'Events', + }), + path: `${USERS_PATH}/events`, + }, + ], +}; + +const hostsLinks: LinkItem = { + id: SecurityPageName.hosts, + title: HOSTS, + landingImage: hostsPageImg, + description: i18n.translate('xpack.securitySolution.landing.threatHunting.hostsDescription', { + defaultMessage: 'A comprehensive overview of all hosts and host-related security events.', + }), + path: HOSTS_PATH, + globalSearchKeywords: [ + i18n.translate('xpack.securitySolution.appLinks.hosts', { + defaultMessage: 'Hosts', + }), + ], + links: [ + { + id: SecurityPageName.uncommonProcesses, + title: i18n.translate('xpack.securitySolution.appLinks.hosts.uncommonProcesses', { + defaultMessage: 'Uncommon Processes', + }), + path: `${HOSTS_PATH}/uncommonProcesses`, + }, + { + id: SecurityPageName.hostsAnomalies, + title: i18n.translate('xpack.securitySolution.appLinks.hosts.anomalies', { + defaultMessage: 'Anomalies', + }), + path: `${HOSTS_PATH}/anomalies`, + licenseType: 'gold', + }, + { + id: SecurityPageName.hostsEvents, + title: i18n.translate('xpack.securitySolution.appLinks.hosts.events', { + defaultMessage: 'Events', + }), + path: `${HOSTS_PATH}/events`, + }, + { + id: SecurityPageName.hostsRisk, + title: i18n.translate('xpack.securitySolution.appLinks.hosts.risk', { + defaultMessage: 'Host risk', + }), + path: `${HOSTS_PATH}/hostRisk`, + }, + { + id: SecurityPageName.sessions, + title: i18n.translate('xpack.securitySolution.appLinks.hosts.sessions', { + defaultMessage: 'Sessions', + }), + path: `${HOSTS_PATH}/sessions`, + isBeta: false, + licenseType: 'enterprise', + }, + ], +}; + +export const exploreLinks = [hostsLinks, networkLinks, usersLinks]; diff --git a/x-pack/plugins/security_solution/public/explore/network/index.ts b/x-pack/plugins/security_solution/public/explore/network/index.ts deleted file mode 100644 index 8dd650c0f5ebf..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/network/index.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { Storage } from '@kbn/kibana-utils-plugin/public'; -import { TableId } from '../../../common/types'; -import type { SecuritySubPluginWithStore } from '../../app/types'; -import { routes } from './routes'; -import type { NetworkState } from './store'; -import { initialNetworkState, networkReducer } from './store'; -import { getDataTablesInStorageByIds } from '../../timelines/containers/local_storage'; - -export class Network { - public setup() {} - - public start(storage: Storage): SecuritySubPluginWithStore<'network', NetworkState> { - return { - routes, - storageDataTables: { - tableById: getDataTablesInStorageByIds(storage, [TableId.networkPageEvents]), - }, - store: { - initialState: { network: initialNetworkState }, - reducer: { network: networkReducer }, - }, - }; - } -} diff --git a/x-pack/plugins/security_solution/public/explore/network/links.ts b/x-pack/plugins/security_solution/public/explore/network/links.ts deleted file mode 100644 index f762d09dd2ecd..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/network/links.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { NETWORK_PATH, SecurityPageName } from '../../../common/constants'; -import { NETWORK } from '../../app/translations'; -import type { LinkItem } from '../../common/links/types'; -import networkPageImg from '../../common/images/network_page.png'; - -export const links: LinkItem = { - id: SecurityPageName.network, - title: NETWORK, - landingImage: networkPageImg, - description: i18n.translate('xpack.securitySolution.appLinks.network.description', { - defaultMessage: - 'Provides key activity metrics in an interactive map as well as event tables that enable interaction with the Timeline.', - }), - path: NETWORK_PATH, - globalSearchKeywords: [ - i18n.translate('xpack.securitySolution.appLinks.network', { - defaultMessage: 'Network', - }), - ], - links: [ - { - id: SecurityPageName.networkDns, - title: i18n.translate('xpack.securitySolution.appLinks.network.dns', { - defaultMessage: 'DNS', - }), - path: `${NETWORK_PATH}/dns`, - }, - { - id: SecurityPageName.networkHttp, - title: i18n.translate('xpack.securitySolution.appLinks.network.http', { - defaultMessage: 'HTTP', - }), - path: `${NETWORK_PATH}/http`, - }, - { - id: SecurityPageName.networkTls, - title: i18n.translate('xpack.securitySolution.appLinks.network.tls', { - defaultMessage: 'TLS', - }), - path: `${NETWORK_PATH}/tls`, - }, - { - id: SecurityPageName.networkAnomalies, - title: i18n.translate('xpack.securitySolution.appLinks.hosts.anomalies', { - defaultMessage: 'Anomalies', - }), - path: `${NETWORK_PATH}/anomalies`, - licenseType: 'gold', - }, - { - id: SecurityPageName.networkEvents, - title: i18n.translate('xpack.securitySolution.appLinks.network.events', { - defaultMessage: 'Events', - }), - path: `${NETWORK_PATH}/events`, - }, - ], -}; diff --git a/x-pack/plugins/security_solution/public/explore/network/routes.tsx b/x-pack/plugins/security_solution/public/explore/network/routes.tsx deleted file mode 100644 index 7a5f9fc8dd98f..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/network/routes.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; -import { NetworkContainer } from './pages'; - -import type { SecuritySubPluginRoutes } from '../../app/types'; -import { SecurityPageName } from '../../app/types'; -import { NETWORK_PATH } from '../../../common/constants'; -import { PluginTemplateWrapper } from '../../common/components/plugin_template_wrapper'; - -export const NetworkRoutes = () => ( - - - - - -); - -export const routes: SecuritySubPluginRoutes = [ - { - path: NETWORK_PATH, - component: NetworkRoutes, - }, -]; diff --git a/x-pack/plugins/security_solution/public/explore/routes.tsx b/x-pack/plugins/security_solution/public/explore/routes.tsx new file mode 100644 index 0000000000000..0698402623953 --- /dev/null +++ b/x-pack/plugins/security_solution/public/explore/routes.tsx @@ -0,0 +1,56 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; +import { UsersContainer } from './users/pages'; +import { HostsContainer } from './hosts/pages'; +import { NetworkContainer } from './network/pages'; + +import type { SecuritySubPluginRoutes } from '../app/types'; +import { SecurityPageName } from '../app/types'; +import { HOSTS_PATH, NETWORK_PATH, USERS_PATH } from '../../common/constants'; +import { PluginTemplateWrapper } from '../common/components/plugin_template_wrapper'; + +const NetworkRoutes = () => ( + + + + + +); + +const UsersRoutes = () => ( + + + + + +); + +const HostsRoutes = () => ( + + + + + +); + +export const routes: SecuritySubPluginRoutes = [ + { + path: NETWORK_PATH, + component: NetworkRoutes, + }, + { + path: USERS_PATH, + component: UsersRoutes, + }, + { + path: HOSTS_PATH, + component: HostsRoutes, + }, +]; diff --git a/x-pack/plugins/security_solution/public/explore/users/index.ts b/x-pack/plugins/security_solution/public/explore/users/index.ts deleted file mode 100644 index 770cf39102c90..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/users/index.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { Storage } from '@kbn/kibana-utils-plugin/public'; -import type { SecuritySubPluginWithStore } from '../../app/types'; -import { routes } from './routes'; -import type { usersModel } from './store'; -import { initialUsersState, usersReducer } from './store'; - -export class Users { - public setup() {} - - public start(storage: Storage): SecuritySubPluginWithStore<'users', usersModel.UsersModel> { - return { - routes, - store: { - initialState: { users: initialUsersState }, - reducer: { users: usersReducer }, - }, - }; - } -} diff --git a/x-pack/plugins/security_solution/public/explore/users/links.ts b/x-pack/plugins/security_solution/public/explore/users/links.ts deleted file mode 100644 index 177197dcbd756..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/users/links.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { i18n } from '@kbn/i18n'; -import { SecurityPageName, USERS_PATH } from '../../../common/constants'; -import { USERS } from '../../app/translations'; -import type { LinkItem } from '../../common/links/types'; -import userPageImg from '../../common/images/users_page.png'; - -export const links: LinkItem = { - id: SecurityPageName.users, - title: USERS, - landingImage: userPageImg, - description: i18n.translate('xpack.securitySolution.appLinks.users.description', { - defaultMessage: - 'A comprehensive overview of user data that enables understanding of authentication and user behavior within your environment.', - }), - path: USERS_PATH, - globalSearchKeywords: [ - i18n.translate('xpack.securitySolution.appLinks.users', { - defaultMessage: 'Users', - }), - ], - links: [ - { - id: SecurityPageName.usersAuthentications, - title: i18n.translate('xpack.securitySolution.appLinks.users.authentications', { - defaultMessage: 'Authentications', - }), - path: `${USERS_PATH}/authentications`, - }, - { - id: SecurityPageName.usersAnomalies, - title: i18n.translate('xpack.securitySolution.appLinks.users.anomalies', { - defaultMessage: 'Anomalies', - }), - path: `${USERS_PATH}/anomalies`, - licenseType: 'gold', - }, - { - id: SecurityPageName.usersRisk, - title: i18n.translate('xpack.securitySolution.appLinks.users.risk', { - defaultMessage: 'User risk', - }), - path: `${USERS_PATH}/userRisk`, - }, - { - id: SecurityPageName.usersEvents, - title: i18n.translate('xpack.securitySolution.appLinks.users.events', { - defaultMessage: 'Events', - }), - path: `${USERS_PATH}/events`, - }, - ], -}; diff --git a/x-pack/plugins/security_solution/public/explore/users/routes.tsx b/x-pack/plugins/security_solution/public/explore/users/routes.tsx deleted file mode 100644 index c5b93618316e4..0000000000000 --- a/x-pack/plugins/security_solution/public/explore/users/routes.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { TrackApplicationView } from '@kbn/usage-collection-plugin/public'; -import { UsersContainer } from './pages'; - -import type { SecuritySubPluginRoutes } from '../../app/types'; -import { SecurityPageName } from '../../app/types'; -import { USERS_PATH } from '../../../common/constants'; -import { PluginTemplateWrapper } from '../../common/components/plugin_template_wrapper'; - -export const UsersRoutes = () => ( - - - - - -); - -export const routes: SecuritySubPluginRoutes = [ - { - path: USERS_PATH, - component: UsersRoutes, - }, -]; diff --git a/x-pack/plugins/security_solution/public/explore/users/store/reducer.ts b/x-pack/plugins/security_solution/public/explore/users/store/reducer.ts index 3577daf4ce547..5bb7615ff198a 100644 --- a/x-pack/plugins/security_solution/public/explore/users/store/reducer.ts +++ b/x-pack/plugins/security_solution/public/explore/users/store/reducer.ts @@ -25,7 +25,9 @@ import { Direction } from '../../../../common/search_strategy/common'; import { RiskScoreFields } from '../../../../common/search_strategy'; import { UsersFields } from '../../../../common/search_strategy/security_solution/users/common'; -export const initialUsersState: UsersModel = { +export type UsersState = UsersModel; + +export const initialUsersState: UsersState = { page: { queries: { [UsersTableType.allUsers]: { diff --git a/x-pack/plugins/security_solution/public/landing_pages/links.ts b/x-pack/plugins/security_solution/public/landing_pages/links.ts index 36553016bd8bf..8a0681fa01f72 100644 --- a/x-pack/plugins/security_solution/public/landing_pages/links.ts +++ b/x-pack/plugins/security_solution/public/landing_pages/links.ts @@ -15,9 +15,7 @@ import { import { DASHBOARDS, EXPLORE } from '../app/translations'; import type { LinkItem } from '../common/links/types'; import { overviewLinks, detectionResponseLinks, entityAnalyticsLinks } from '../overview/links'; -import { links as hostsLinks } from '../explore/hosts/links'; -import { links as networkLinks } from '../explore/network/links'; -import { links as usersLinks } from '../explore/users/links'; +import { exploreLinks } from '../explore/links'; import { links as kubernetesLinks } from '../kubernetes/links'; import { dashboardLinks as cloudSecurityPostureLinks } from '../cloud_security_posture/links'; @@ -53,6 +51,6 @@ export const threatHuntingLandingLinks: LinkItem = { defaultMessage: 'Explore', }), ], - links: [hostsLinks, networkLinks, usersLinks], + links: exploreLinks, skipUrlState: true, }; diff --git a/x-pack/plugins/security_solution/public/lazy_sub_plugins.tsx b/x-pack/plugins/security_solution/public/lazy_sub_plugins.tsx index 2615ec90ecda4..1d93699ff1b47 100644 --- a/x-pack/plugins/security_solution/public/lazy_sub_plugins.tsx +++ b/x-pack/plugins/security_solution/public/lazy_sub_plugins.tsx @@ -13,9 +13,7 @@ import { Cases } from './cases'; import { Detections } from './detections'; import { Exceptions } from './exceptions'; -import { Hosts } from './explore/hosts'; -import { Users } from './explore/users'; -import { Network } from './explore/network'; +import { Explore } from './explore'; import { Kubernetes } from './kubernetes'; import { Overview } from './overview'; import { Rules } from './rules'; @@ -32,9 +30,7 @@ const subPluginClasses = { Detections, Cases, Exceptions, - Hosts, - Users, - Network, + Explore, Kubernetes, Overview, Rules, diff --git a/x-pack/plugins/security_solution/public/plugin.tsx b/x-pack/plugins/security_solution/public/plugin.tsx index d09147ed4eb96..741e485d34dae 100644 --- a/x-pack/plugins/security_solution/public/plugin.tsx +++ b/x-pack/plugins/security_solution/public/plugin.tsx @@ -347,9 +347,7 @@ export class Plugin implements IPlugin; exceptions: ReturnType; [CASES_SUB_PLUGIN_KEY]: ReturnType; - hosts: ReturnType; - users: ReturnType; - network: ReturnType; + explore: ReturnType; kubernetes: ReturnType; overview: ReturnType; timelines: ReturnType;