From 9a535162bae34b28f4c057e58eabb91609032f06 Mon Sep 17 00:00:00 2001
From: Pablo Neves Machado
Date: Wed, 7 Sep 2022 13:04:27 +0200
Subject: [PATCH 1/2] Delete host risk card from overview page
---
.../security_solution/common/constants.ts | 3 +
.../overview/risky_hosts_panel.spec.ts | 80 ---------
.../cypress/screens/overview.ts | 15 --
.../cti_details/host_risk_summary.tsx | 2 +-
.../host_risk_information/index.tsx | 3 +-
.../hosts/components/kpi_hosts/index.tsx | 2 +-
.../link_panel/inner_link_panel.tsx | 4 +-
.../components/link_panel/translations.ts | 15 ++
.../threat_intel_panel_view.tsx | 3 +-
.../overview_cti_links/translations.ts | 4 +
.../overview_risky_host_links/index.test.tsx | 112 -------------
.../overview_risky_host_links/index.tsx | 53 ------
.../navigate_to_host.tsx | 43 -----
.../risky_hosts_disabled_module.test.tsx | 54 ------
.../risky_hosts_disabled_module.tsx | 51 ------
.../risky_hosts_enabled_module.test.tsx | 82 ---------
.../risky_hosts_enabled_module.tsx | 43 -----
.../risky_hosts_panel_view.test.tsx | 67 --------
.../risky_hosts_panel_view.tsx | 157 ------------------
.../overview_risky_host_links/translations.ts | 72 --------
.../use_risky_hosts_dashboard_id.ts | 41 -----
.../use_risky_hosts_dashboard_links.tsx | 73 --------
.../public/overview/pages/overview.tsx | 20 ---
23 files changed, 28 insertions(+), 971 deletions(-)
delete mode 100644 x-pack/plugins/security_solution/cypress/integration/overview/risky_hosts_panel.spec.ts
create mode 100644 x-pack/plugins/security_solution/public/overview/components/link_panel/translations.ts
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.test.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/navigate_to_host.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.test.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.test.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.test.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx
delete mode 100644 x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/translations.ts
delete mode 100644 x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_id.ts
delete mode 100644 x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_links.tsx
diff --git a/x-pack/plugins/security_solution/common/constants.ts b/x-pack/plugins/security_solution/common/constants.ts
index 6f3958cbb54e1..a59f57e45cdd0 100644
--- a/x-pack/plugins/security_solution/common/constants.ts
+++ b/x-pack/plugins/security_solution/common/constants.ts
@@ -458,3 +458,6 @@ export enum BulkActionsDryRunErrCode {
MACHINE_LEARNING_AUTH = 'MACHINE_LEARNING_AUTH',
MACHINE_LEARNING_INDEX_PATTERN = 'MACHINE_LEARNING_INDEX_PATTERN',
}
+
+export const RISKY_HOSTS_DOC_LINK =
+ 'https://www.github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md';
diff --git a/x-pack/plugins/security_solution/cypress/integration/overview/risky_hosts_panel.spec.ts b/x-pack/plugins/security_solution/cypress/integration/overview/risky_hosts_panel.spec.ts
deleted file mode 100644
index 686acd5fd048c..0000000000000
--- a/x-pack/plugins/security_solution/cypress/integration/overview/risky_hosts_panel.spec.ts
+++ /dev/null
@@ -1,80 +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 {
- OVERVIEW_RISKY_HOSTS_ENABLE_MODULE_BUTTON,
- OVERVIEW_RISKY_HOSTS_LINKS,
- OVERVIEW_RISKY_HOSTS_LINKS_ERROR_INNER_PANEL,
- OVERVIEW_RISKY_HOSTS_LINKS_WARNING_INNER_PANEL,
- OVERVIEW_RISKY_HOSTS_TOTAL_EVENT_COUNT,
- OVERVIEW_RISKY_HOSTS_DOC_LINK,
- OVERVIEW_RISKY_HOSTS_IMPORT_DASHBOARD_BUTTON,
-} from '../../screens/overview';
-
-import { login, visit } from '../../tasks/login';
-import { OVERVIEW_URL } from '../../urls/navigation';
-import { cleanKibana } from '../../tasks/common';
-import { changeSpace } from '../../tasks/kibana_navigation';
-import { createSpace, removeSpace } from '../../tasks/api_calls/spaces';
-import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver';
-
-const testSpaceName = 'test';
-
-describe('Risky Hosts Link Panel', () => {
- before(() => {
- cleanKibana();
- login();
- });
-
- it('renders disabled panel view as expected', () => {
- visit(OVERVIEW_URL);
- cy.get(`${OVERVIEW_RISKY_HOSTS_LINKS} ${OVERVIEW_RISKY_HOSTS_LINKS_ERROR_INNER_PANEL}`).should(
- 'exist'
- );
- cy.get(`${OVERVIEW_RISKY_HOSTS_TOTAL_EVENT_COUNT}`).should('have.text', 'Showing: 0 hosts');
- cy.get(`${OVERVIEW_RISKY_HOSTS_ENABLE_MODULE_BUTTON}`).should('exist');
- cy.get(`${OVERVIEW_RISKY_HOSTS_DOC_LINK}`)
- .should('have.attr', 'href')
- .and('match', /host-risk-score.md/);
- });
-
- describe('enabled module', () => {
- before(() => {
- esArchiverLoad('risky_hosts');
- createSpace(testSpaceName);
- });
-
- after(() => {
- esArchiverUnload('risky_hosts');
- removeSpace(testSpaceName);
- });
-
- it('renders disabled dashboard module as expected when there are no hosts in the selected time period', () => {
- visit(
- `${OVERVIEW_URL}?sourcerer=(timerange:(from:%272021-07-08T04:00:00.000Z%27,kind:absolute,to:%272021-07-09T03:59:59.999Z%27))`
- );
- cy.get(
- `${OVERVIEW_RISKY_HOSTS_LINKS} ${OVERVIEW_RISKY_HOSTS_LINKS_WARNING_INNER_PANEL}`
- ).should('exist');
- cy.get(`${OVERVIEW_RISKY_HOSTS_TOTAL_EVENT_COUNT}`).should('have.text', 'Showing: 0 hosts');
- });
-
- it('renders space aware dashboard module as expected when there are hosts in the selected time period', () => {
- visit(OVERVIEW_URL);
- cy.get(
- `${OVERVIEW_RISKY_HOSTS_LINKS} ${OVERVIEW_RISKY_HOSTS_LINKS_WARNING_INNER_PANEL}`
- ).should('not.exist');
- cy.get(`${OVERVIEW_RISKY_HOSTS_IMPORT_DASHBOARD_BUTTON}`).should('exist');
- cy.get(`${OVERVIEW_RISKY_HOSTS_TOTAL_EVENT_COUNT}`).should('have.text', 'Showing: 6 hosts');
-
- changeSpace(testSpaceName);
- cy.visit(`/s/${testSpaceName}${OVERVIEW_URL}`);
- cy.get(`${OVERVIEW_RISKY_HOSTS_TOTAL_EVENT_COUNT}`).should('have.text', 'Showing: 0 hosts');
- cy.get(`${OVERVIEW_RISKY_HOSTS_ENABLE_MODULE_BUTTON}`).should('exist');
- });
- });
-});
diff --git a/x-pack/plugins/security_solution/cypress/screens/overview.ts b/x-pack/plugins/security_solution/cypress/screens/overview.ts
index 1e91e4fe462b9..14bfce599dfaf 100644
--- a/x-pack/plugins/security_solution/cypress/screens/overview.ts
+++ b/x-pack/plugins/security_solution/cypress/screens/overview.ts
@@ -151,19 +151,4 @@ export const OVERVIEW_CTI_LINKS_ERROR_INNER_PANEL = '[data-test-subj="cti-inner-
export const OVERVIEW_CTI_TOTAL_EVENT_COUNT = `${OVERVIEW_CTI_LINKS} [data-test-subj="header-panel-subtitle"]`;
export const OVERVIEW_CTI_ENABLE_MODULE_BUTTON = '[data-test-subj="cti-enable-module-button"]';
-export const OVERVIEW_RISKY_HOSTS_LINKS = '[data-test-subj="risky-hosts-dashboard-links"]';
-export const OVERVIEW_RISKY_HOSTS_LINKS_ERROR_INNER_PANEL =
- '[data-test-subj="risky-hosts-inner-panel-danger"]';
-export const OVERVIEW_RISKY_HOSTS_LINKS_WARNING_INNER_PANEL =
- '[data-test-subj="risky-hosts-inner-panel-warning"]';
-export const OVERVIEW_RISKY_HOSTS_VIEW_DASHBOARD_BUTTON =
- '[data-test-subj="risky-hosts-view-dashboard-button"]';
-export const OVERVIEW_RISKY_HOSTS_IMPORT_DASHBOARD_BUTTON =
- '[data-test-subj="create-saved-object-button"]';
-export const OVERVIEW_RISKY_HOSTS_DOC_LINK =
- '[data-test-subj="risky-hosts-inner-panel-danger-learn-more"]';
-export const OVERVIEW_RISKY_HOSTS_TOTAL_EVENT_COUNT = `${OVERVIEW_RISKY_HOSTS_LINKS} [data-test-subj="header-panel-subtitle"]`;
-export const OVERVIEW_RISKY_HOSTS_ENABLE_MODULE_BUTTON =
- '[data-test-subj="disabled-open-in-console-button-with-tooltip"]';
-
export const OVERVIEW_ALERTS_HISTOGRAM = '[data-test-subj="alerts-histogram-panel"]';
diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/host_risk_summary.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/host_risk_summary.tsx
index 9f425da6475d7..970656933b938 100644
--- a/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/host_risk_summary.tsx
+++ b/x-pack/plugins/security_solution/public/common/components/event_details/cti_details/host_risk_summary.tsx
@@ -9,10 +9,10 @@ import React from 'react';
import { EuiLoadingSpinner, EuiPanel, EuiSpacer, EuiLink, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import * as i18n from './translations';
-import { RISKY_HOSTS_DOC_LINK } from '../../../../overview/components/overview_risky_host_links/risky_hosts_disabled_module';
import { EnrichedDataRow, ThreatSummaryPanelHeader } from './threat_summary_view';
import { RiskScore } from '../../severity/common';
import type { HostRisk } from '../../../../risk_score/containers';
+import { RISKY_HOSTS_DOC_LINK } from '../../../../../common/constants';
const HostRiskSummaryComponent: React.FC<{
hostRisk: HostRisk;
diff --git a/x-pack/plugins/security_solution/public/hosts/components/host_risk_information/index.tsx b/x-pack/plugins/security_solution/public/hosts/components/host_risk_information/index.tsx
index 11d3575a27567..ea1ecf8c9d652 100644
--- a/x-pack/plugins/security_solution/public/hosts/components/host_risk_information/index.tsx
+++ b/x-pack/plugins/security_solution/public/hosts/components/host_risk_information/index.tsx
@@ -27,12 +27,11 @@ import {
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';
-import { RISKY_HOSTS_DOC_LINK } from '../../../overview/components/overview_risky_host_links/risky_hosts_disabled_module';
-
import * as i18n from './translations';
import { useOnOpenCloseHandler } from '../../../helper_hooks';
import { RiskScore } from '../../../common/components/severity/common';
import { RiskSeverity } from '../../../../common/search_strategy';
+import { RISKY_HOSTS_DOC_LINK } from '../../../../common/constants';
const tableColumns: Array> = [
{
diff --git a/x-pack/plugins/security_solution/public/hosts/components/kpi_hosts/index.tsx b/x-pack/plugins/security_solution/public/hosts/components/kpi_hosts/index.tsx
index 7c73cb4f24508..f7c9352f3a951 100644
--- a/x-pack/plugins/security_solution/public/hosts/components/kpi_hosts/index.tsx
+++ b/x-pack/plugins/security_solution/public/hosts/components/kpi_hosts/index.tsx
@@ -12,9 +12,9 @@ import { HostsKpiHosts } from './hosts';
import { HostsKpiUniqueIps } from './unique_ips';
import type { HostsKpiProps } from './types';
import { CallOutSwitcher } from '../../../common/components/callouts';
-import { RISKY_HOSTS_DOC_LINK } from '../../../overview/components/overview_risky_host_links/risky_hosts_disabled_module';
import * as i18n from './translations';
import { useHostRiskScore } from '../../../risk_score/containers';
+import { RISKY_HOSTS_DOC_LINK } from '../../../../common/constants';
export const HostsKpiComponent = React.memo(
({ filterQuery, from, indexNames, to, setQuery, skip, updateDateRange }) => {
diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.tsx b/x-pack/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.tsx
index c4f234b43efd0..f76b446ac72e8 100644
--- a/x-pack/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.tsx
+++ b/x-pack/plugins/security_solution/public/overview/components/link_panel/inner_link_panel.tsx
@@ -8,7 +8,7 @@
import React from 'react';
import styled from 'styled-components';
import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLink, EuiSplitPanel, EuiText } from '@elastic/eui';
-import { LEARN_MORE } from '../overview_risky_host_links/translations';
+import * as i18n from './translations';
const ButtonContainer = styled(EuiFlexGroup)`
padding: ${({ theme }) => theme.eui.euiSizeS};
@@ -66,7 +66,7 @@ export const InnerLinkPanel = ({
data-test-subj={`${dataTestSubj}-learn-more`}
external
>
- {LEARN_MORE}
+ {i18n.LEARN_MORE}
)}
diff --git a/x-pack/plugins/security_solution/public/overview/components/link_panel/translations.ts b/x-pack/plugins/security_solution/public/overview/components/link_panel/translations.ts
new file mode 100644
index 0000000000000..edbfa06477ba5
--- /dev/null
+++ b/x-pack/plugins/security_solution/public/overview/components/link_panel/translations.ts
@@ -0,0 +1,15 @@
+/*
+ * 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';
+
+export const LEARN_MORE = i18n.translate(
+ 'xpack.securitySolution.overview.linkPanelLearnMoreButton',
+ {
+ defaultMessage: 'Learn More',
+ }
+);
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx
index 371f9a1e79f20..c6a623f19681f 100644
--- a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx
+++ b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/threat_intel_panel_view.tsx
@@ -16,7 +16,6 @@ import type { LinkPanelViewProps } from '../link_panel/types';
import { shortenCountIntoString } from '../../../common/utils/shorten_count_into_string';
import { Link } from '../link_panel/link';
import { ID as CTIEventCountQueryId } from '../../containers/overview_cti_links/use_ti_data_sources';
-import { LINK_COPY } from '../overview_risky_host_links/translations';
const columns: Array> = [
{ name: 'Name', field: 'title', sortable: true, truncateText: true, width: '100%' },
@@ -34,7 +33,7 @@ const columns: Array> = [
field: 'path',
truncateText: true,
width: '80px',
- render: (path: string) => ,
+ render: (path: string) => ,
},
];
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/translations.ts b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/translations.ts
index 775dab6721da1..ef7f1f6540ee5 100644
--- a/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/translations.ts
+++ b/x-pack/plugins/security_solution/public/overview/components/overview_cti_links/translations.ts
@@ -42,3 +42,7 @@ export const OTHER_DATA_SOURCE_TITLE = i18n.translate(
defaultMessage: 'Others',
}
);
+
+export const LINK_COPY = i18n.translate('xpack.securitySolution.overview.ctiLinkSource', {
+ defaultMessage: 'Source',
+});
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.test.tsx
deleted file mode 100644
index b0c5f8bc7cff9..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.test.tsx
+++ /dev/null
@@ -1,112 +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 { Provider } from 'react-redux';
-import { cloneDeep } from 'lodash/fp';
-import { render, screen } from '@testing-library/react';
-import { I18nProvider } from '@kbn/i18n-react';
-import { ThemeProvider } from 'styled-components';
-import { mockTheme } from '../overview_cti_links/mock';
-import { RiskyHostLinks } from '.';
-import type { State } from '../../../common/store';
-import { createStore } from '../../../common/store';
-import {
- createSecuritySolutionStorageMock,
- kibanaObservable,
- mockGlobalState,
- SUB_PLUGINS_REDUCER,
-} from '../../../common/mock';
-
-import { useRiskyHostsDashboardLinks } from '../../containers/overview_risky_host_links/use_risky_hosts_dashboard_links';
-import { useHostRiskScore } from '../../../risk_score/containers';
-import { useDashboardButtonHref } from '../../../common/hooks/use_dashboard_button_href';
-
-jest.mock('../../../common/lib/kibana');
-
-jest.mock('../../../risk_score/containers');
-const useHostRiskScoreMock = useHostRiskScore as jest.Mock;
-
-jest.mock('../../../common/hooks/use_dashboard_button_href');
-const useRiskyHostsDashboardButtonHrefMock = useDashboardButtonHref as jest.Mock;
-useRiskyHostsDashboardButtonHrefMock.mockReturnValue({ buttonHref: '/test' });
-
-jest.mock('../../containers/overview_risky_host_links/use_risky_hosts_dashboard_links');
-const useRiskyHostsDashboardLinksMock = useRiskyHostsDashboardLinks as jest.Mock;
-useRiskyHostsDashboardLinksMock.mockReturnValue({
- listItemsWithLinks: [{ title: 'a', count: 1, path: '/test' }],
-});
-
-describe('RiskyHostLinks', () => {
- const state: State = mockGlobalState;
-
- const { storage } = createSecuritySolutionStorageMock();
- let store = createStore(state, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
-
- beforeEach(() => {
- const myState = cloneDeep(state);
- store = createStore(myState, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
- });
-
- it('renders enabled module view if module is enabled', () => {
- useHostRiskScoreMock.mockReturnValueOnce([
- false,
- {
- data: [],
- isModuleEnabled: true,
- },
- ]);
-
- render(
-
-
-
-
-
-
-
- );
-
- expect(screen.queryByTestId('risky-hosts-enable-module-button')).not.toBeInTheDocument();
- });
-
- it('renders disabled module view if module is disabled', () => {
- useHostRiskScoreMock.mockReturnValueOnce([
- false,
- {
- data: [],
- isModuleEnabled: false,
- },
- ]);
-
- render(
-
-
-
-
-
-
-
- );
-
- expect(screen.getByTestId('disabled-open-in-console-button-with-tooltip')).toBeInTheDocument();
- });
-});
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.tsx
deleted file mode 100644
index df6286647e82e..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/index.tsx
+++ /dev/null
@@ -1,53 +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 { RiskyHostsEnabledModule } from './risky_hosts_enabled_module';
-import { RiskyHostsDisabledModule } from './risky_hosts_disabled_module';
-import { useQueryInspector } from '../../../common/components/page/manage_query';
-import type { GlobalTimeArgs } from '../../../common/containers/use_global_time';
-import { useHostRiskScore, HostRiskScoreQueryId } from '../../../risk_score/containers';
-export interface RiskyHostLinksProps extends Pick {
- timerange: { to: string; from: string };
-}
-
-const QUERY_ID = HostRiskScoreQueryId.OVERVIEW_RISKY_HOSTS;
-
-const RiskyHostLinksComponent: React.FC = ({
- timerange,
- deleteQuery,
- setQuery,
-}) => {
- const [loading, { data, isModuleEnabled, inspect, refetch }] = useHostRiskScore({
- timerange,
- });
-
- useQueryInspector({
- queryId: QUERY_ID,
- loading,
- refetch,
- setQuery,
- deleteQuery,
- inspect,
- });
-
- switch (isModuleEnabled) {
- case true:
- return (
-
- );
- case false:
- return ;
- case undefined:
- default:
- return null;
- }
-};
-
-export const RiskyHostLinks = React.memo(RiskyHostLinksComponent);
-RiskyHostLinks.displayName = 'RiskyHostLinks';
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/navigate_to_host.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/navigate_to_host.tsx
deleted file mode 100644
index afa0cfe7e9ae8..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/navigate_to_host.tsx
+++ /dev/null
@@ -1,43 +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, { useCallback } from 'react';
-import { EuiButtonEmpty, EuiText, EuiToolTip } from '@elastic/eui';
-import { APP_UI_ID, SecurityPageName } from '../../../../common/constants';
-import { useKibana } from '../../../common/lib/kibana';
-
-export const NavigateToHost: React.FC<{ name: string }> = ({ name }): JSX.Element => {
- const { navigateToApp } = useKibana().services.application;
- const { filterManager } = useKibana().services.data.query;
-
- const goToHostPage = useCallback(
- (e) => {
- e.preventDefault();
- filterManager.addFilters([
- {
- meta: {
- alias: null,
- disabled: false,
- negate: false,
- },
- query: { match_phrase: { 'host.name': name } },
- },
- ]);
- navigateToApp(APP_UI_ID, {
- deepLinkId: SecurityPageName.hosts,
- });
- },
- [filterManager, name, navigateToApp]
- );
- return (
-
-
- {name}
-
-
- );
-};
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.test.tsx
deleted file mode 100644
index e8a50c83a3a27..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.test.tsx
+++ /dev/null
@@ -1,54 +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 { Provider } from 'react-redux';
-import { cloneDeep } from 'lodash/fp';
-import { render, screen } from '@testing-library/react';
-import { I18nProvider } from '@kbn/i18n-react';
-import { ThemeProvider } from 'styled-components';
-import type { State } from '../../../common/store';
-import { createStore } from '../../../common/store';
-import {
- createSecuritySolutionStorageMock,
- kibanaObservable,
- mockGlobalState,
- SUB_PLUGINS_REDUCER,
-} from '../../../common/mock';
-import { RiskyHostsDisabledModule } from './risky_hosts_disabled_module';
-import { mockTheme } from '../overview_cti_links/mock';
-
-jest.mock('../../../common/lib/kibana');
-
-describe('RiskyHostsModule', () => {
- const state: State = mockGlobalState;
-
- const { storage } = createSecuritySolutionStorageMock();
- let store = createStore(state, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
-
- beforeEach(() => {
- const myState = cloneDeep(state);
- store = createStore(myState, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
- });
-
- it('renders expected children', () => {
- render(
-
-
-
-
-
-
-
- );
-
- expect(screen.getByTestId('risky-hosts-dashboard-links')).toBeInTheDocument();
- expect(screen.getByTestId('risky-hosts-inner-panel-danger-learn-more')).toBeInTheDocument();
-
- expect(screen.getByTestId('disabled-open-in-console-button-with-tooltip')).toBeInTheDocument();
- });
-});
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.tsx
deleted file mode 100644
index e13089dc6404e..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_disabled_module.tsx
+++ /dev/null
@@ -1,51 +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 * as i18n from './translations';
-import { DisabledLinkPanel } from '../link_panel/disabled_link_panel';
-import { RiskyHostsPanelView } from './risky_hosts_panel_view';
-
-import { ENABLE_VIA_DEV_TOOLS } from './translations';
-
-import { OpenInDevConsoleButton } from '../../../common/components/open_in_dev_console';
-import { useCheckSignalIndex } from '../../../detections/containers/detection_engine/alerts/use_check_signal_index';
-import type { LinkPanelListItem } from '../link_panel';
-import { useEnableHostRiskFromUrl } from '../../../common/hooks/use_enable_host_risk_from_url';
-
-export const RISKY_HOSTS_DOC_LINK =
- 'https://www.github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md';
-
-const emptyList: LinkPanelListItem[] = [];
-
-export const RiskyHostsDisabledModuleComponent = () => {
- const loadFromUrl = useEnableHostRiskFromUrl();
- const { signalIndexExists } = useCheckSignalIndex();
-
- return (
-
- }
- />
- );
-};
-
-export const RiskyHostsDisabledModule = React.memo(RiskyHostsDisabledModuleComponent);
-RiskyHostsDisabledModule.displayName = 'RiskyHostsDisabledModule';
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.test.tsx
deleted file mode 100644
index 46956823d1961..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.test.tsx
+++ /dev/null
@@ -1,82 +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 { Provider } from 'react-redux';
-import { cloneDeep } from 'lodash/fp';
-import { render, screen } from '@testing-library/react';
-import { I18nProvider } from '@kbn/i18n-react';
-import { ThemeProvider } from 'styled-components';
-import type { State } from '../../../common/store';
-import { createStore } from '../../../common/store';
-import {
- createSecuritySolutionStorageMock,
- kibanaObservable,
- mockGlobalState,
- SUB_PLUGINS_REDUCER,
-} from '../../../common/mock';
-
-import { useRiskyHostsDashboardLinks } from '../../containers/overview_risky_host_links/use_risky_hosts_dashboard_links';
-import { mockTheme } from '../overview_cti_links/mock';
-import { RiskyHostsEnabledModule } from './risky_hosts_enabled_module';
-import { useDashboardButtonHref } from '../../../common/hooks/use_dashboard_button_href';
-import { RiskSeverity } from '../../../../common/search_strategy';
-
-jest.mock('../../../common/lib/kibana');
-
-jest.mock('../../../common/hooks/use_dashboard_button_href');
-const useRiskyHostsDashboardButtonHrefMock = useDashboardButtonHref as jest.Mock;
-useRiskyHostsDashboardButtonHrefMock.mockReturnValue({ buttonHref: '/test' });
-
-jest.mock('../../containers/overview_risky_host_links/use_risky_hosts_dashboard_links');
-const useRiskyHostsDashboardLinksMock = useRiskyHostsDashboardLinks as jest.Mock;
-useRiskyHostsDashboardLinksMock.mockReturnValue({
- listItemsWithLinks: [{ title: 'a', count: 1, path: '/test' }],
-});
-
-describe('RiskyHostsEnabledModule', () => {
- const state: State = mockGlobalState;
-
- const { storage } = createSecuritySolutionStorageMock();
- let store = createStore(state, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
-
- beforeEach(() => {
- const myState = cloneDeep(state);
- store = createStore(myState, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
- });
-
- it('renders expected children', () => {
- render(
-
-
-
-
-
-
-
- );
- expect(screen.getByTestId('risky-hosts-dashboard-links')).toBeInTheDocument();
- expect(screen.getByTestId('create-saved-object-success-button')).toBeInTheDocument();
- });
-});
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.tsx
deleted file mode 100644
index 49a185d6e1513..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_enabled_module.tsx
+++ /dev/null
@@ -1,43 +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, { useMemo } from 'react';
-import { RiskyHostsPanelView } from './risky_hosts_panel_view';
-import type { LinkPanelListItem } from '../link_panel';
-import { useRiskyHostsDashboardLinks } from '../../containers/overview_risky_host_links/use_risky_hosts_dashboard_links';
-import type { HostRiskScore } from '../../../../common/search_strategy';
-
-const getListItemsFromHits = (items: HostRiskScore[]): LinkPanelListItem[] => {
- return items.map(({ host }) => ({
- title: host.name,
- count: host.risk.calculated_score_norm,
- copy: host.risk.calculated_level,
- path: '',
- }));
-};
-
-const RiskyHostsEnabledModuleComponent: React.FC<{
- from: string;
- hostRiskScore?: HostRiskScore[];
- to: string;
-}> = ({ hostRiskScore, to, from }) => {
- const listItems = useMemo(() => getListItemsFromHits(hostRiskScore || []), [hostRiskScore]);
- const { listItemsWithLinks } = useRiskyHostsDashboardLinks(to, from, listItems);
-
- return (
-
- );
-};
-
-export const RiskyHostsEnabledModule = React.memo(RiskyHostsEnabledModuleComponent);
-RiskyHostsEnabledModule.displayName = 'RiskyHostsEnabledModule';
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.test.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.test.tsx
deleted file mode 100644
index 863bd4fcbd35d..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.test.tsx
+++ /dev/null
@@ -1,67 +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 { render, screen } from '@testing-library/react';
-import type { State } from '../../../common/store';
-import { createStore } from '../../../common/store';
-import {
- createSecuritySolutionStorageMock,
- kibanaObservable,
- mockGlobalState,
- SUB_PLUGINS_REDUCER,
- TestProviders,
-} from '../../../common/mock';
-
-import { RiskyHostsPanelView } from './risky_hosts_panel_view';
-import { useDashboardButtonHref } from '../../../common/hooks/use_dashboard_button_href';
-
-jest.mock('../../../common/lib/kibana');
-
-jest.mock('../../../common/hooks/use_dashboard_button_href');
-const useRiskyHostsDashboardButtonHrefMock = useDashboardButtonHref as jest.Mock;
-useRiskyHostsDashboardButtonHrefMock.mockReturnValue({ buttonHref: '/test' });
-
-describe('RiskyHostsPanelView', () => {
- const state: State = mockGlobalState;
-
- beforeEach(() => {
- const { storage } = createSecuritySolutionStorageMock();
- const store = createStore(state, SUB_PLUGINS_REDUCER, kibanaObservable, storage);
- render(
-
-
-
- );
- });
-
- it('renders title', () => {
- expect(screen.getByTestId('header-section-title')).toHaveTextContent(
- 'Current host risk scores'
- );
- });
-
- it('renders host number', () => {
- expect(screen.getByTestId('header-panel-subtitle')).toHaveTextContent('Showing: 1 host');
- });
-
- it('renders view dashboard button', () => {
- expect(screen.getByTestId('create-saved-object-success-button')).toHaveAttribute(
- 'href',
- '/test'
- );
- expect(screen.getByTestId('create-saved-object-success-button')).toHaveTextContent(
- 'View dashboard'
- );
- });
-});
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx
deleted file mode 100644
index 7aadf6bcfa991..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/risky_hosts_panel_view.tsx
+++ /dev/null
@@ -1,157 +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, { useCallback, useMemo, useState } from 'react';
-
-import type { EuiTableFieldDataColumnType } from '@elastic/eui';
-import { FormattedMessage } from '@kbn/i18n-react';
-import type { SavedObject, SavedObjectAttributes } from '@kbn/core/types';
-import type { LinkPanelListItem } from '../link_panel';
-import { InnerLinkPanel, LinkPanel } from '../link_panel';
-import type { LinkPanelViewProps } from '../link_panel/types';
-import { Link } from '../link_panel/link';
-import * as i18n from './translations';
-import { NavigateToHost } from './navigate_to_host';
-import { HostRiskScoreQueryId } from '../../../risk_score/containers';
-import { useKibana } from '../../../common/lib/kibana';
-import { RISKY_HOSTS_DASHBOARD_TITLE } from '../../../hosts/pages/navigation/constants';
-import { useDashboardButtonHref } from '../../../common/hooks/use_dashboard_button_href';
-import { ImportSavedObjectsButton } from '../../../common/components/create_prebuilt_saved_objects/components/bulk_create_button';
-import { VIEW_DASHBOARD } from '../overview_cti_links/translations';
-
-const columns: Array> = [
- {
- name: 'Host Name',
- field: 'title',
- sortable: true,
- truncateText: true,
- width: '55%',
- render: (name) => () as JSX.Element,
- },
- {
- align: 'right',
- field: 'count',
- name: 'Risk Score',
- render: (riskScore) =>
- Number.isNaN(riskScore) ? riskScore : Number.parseFloat(riskScore).toFixed(2),
- sortable: true,
- truncateText: true,
- width: '15%',
- },
- {
- field: 'copy',
- name: 'Current Risk',
- sortable: true,
- truncateText: true,
- width: '15%',
- },
- {
- field: 'path',
- name: '',
- render: (path: string) => () as JSX.Element,
- truncateText: true,
- width: '80px',
- },
-];
-
-const warningPanel = (
-
-);
-
-const RiskyHostsPanelViewComponent: React.FC = ({
- isInspectEnabled,
- listItems,
- splitPanel,
- totalCount = 0,
- to,
- from,
-}) => {
- const splitPanelElement =
- typeof splitPanel === 'undefined'
- ? listItems.length === 0
- ? warningPanel
- : undefined
- : splitPanel;
-
- const [dashboardUrl, setDashboardUrl] = useState();
- const { buttonHref } = useDashboardButtonHref({
- to,
- from,
- title: RISKY_HOSTS_DASHBOARD_TITLE,
- });
- const {
- services: { dashboard },
- } = useKibana();
-
- const onImportDashboardSuccessCallback = useCallback(
- (response: Array>) => {
- const targetDashboard = response.find(
- (obj) => obj.type === 'dashboard' && obj?.attributes?.title === RISKY_HOSTS_DASHBOARD_TITLE
- );
-
- const fetchDashboardUrl = (targetDashboardId: string | null | undefined) => {
- if (to && from && targetDashboardId) {
- const targetUrl = dashboard?.locator?.getRedirectUrl({
- dashboardId: targetDashboardId,
- timeRange: {
- to,
- from,
- },
- });
-
- setDashboardUrl(targetUrl);
- }
- };
-
- fetchDashboardUrl(targetDashboard?.id);
- },
- [dashboard?.locator, from, to]
- );
-
- return (
-
- ),
- columns,
- dataTestSubj: 'risky-hosts-dashboard-links',
- defaultSortField: 'count',
- defaultSortOrder: 'desc',
- inspectQueryId: isInspectEnabled ? HostRiskScoreQueryId.OVERVIEW_RISKY_HOSTS : undefined,
- listItems,
- panelTitle: i18n.PANEL_TITLE,
- splitPanel: splitPanelElement,
- subtitle: useMemo(
- () => (
-
- ),
- [totalCount]
- ),
- }}
- />
- );
-};
-
-export const RiskyHostsPanelView = React.memo(RiskyHostsPanelViewComponent);
diff --git a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/translations.ts b/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/translations.ts
deleted file mode 100644
index 5ba4bb2323b24..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/components/overview_risky_host_links/translations.ts
+++ /dev/null
@@ -1,72 +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';
-
-export const WARNING_TITLE = i18n.translate(
- 'xpack.securitySolution.overview.riskyHostsDashboardWarningPanelTitle',
- {
- defaultMessage: 'No host risk score data available to display',
- }
-);
-
-export const WARNING_BODY = i18n.translate(
- 'xpack.securitySolution.overview.riskyHostsDashboardWarningPanelBody',
- {
- defaultMessage: `We haven't detected any host risk score data from the hosts in your environment for the selected time range.`,
- }
-);
-
-export const DANGER_TITLE = i18n.translate(
- 'xpack.securitySolution.overview.riskyHostsDashboardDangerPanelTitle',
- {
- defaultMessage: 'No host risk score data',
- }
-);
-
-export const DANGER_BODY = i18n.translate(
- 'xpack.securitySolution.overview.riskyHostsDashboardEnableThreatIntel',
- {
- defaultMessage: 'You must enable the host risk module to view risky hosts.',
- }
-);
-
-export const ENABLE_VIA_DEV_TOOLS = i18n.translate(
- 'xpack.securitySolution.overview.riskyHostsDashboardDangerPanelButton',
- {
- defaultMessage: 'Enable via Dev Tools',
- }
-);
-
-export const LEARN_MORE = i18n.translate(
- 'xpack.securitySolution.overview.riskyHostsDashboardLearnMoreButton',
- {
- defaultMessage: 'Learn More',
- }
-);
-
-export const LINK_COPY = i18n.translate('xpack.securitySolution.overview.riskyHostsSource', {
- defaultMessage: 'Source',
-});
-
-export const PANEL_TITLE = i18n.translate(
- 'xpack.securitySolution.overview.riskyHostsDashboardTitle',
- {
- defaultMessage: 'Current host risk scores',
- }
-);
-
-export const IMPORT_DASHBOARD = i18n.translate('xpack.securitySolution.overview.importDasboard', {
- defaultMessage: 'Import dashboard',
-});
-
-export const ENABLE_RISK_SCORE_POPOVER = i18n.translate(
- 'xpack.securitySolution.overview.enableRiskScorePopoverTitle',
- {
- defaultMessage: 'Alerts need to be available before enabling module',
- }
-);
diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_id.ts b/x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_id.ts
deleted file mode 100644
index 1e0758343ba47..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_id.ts
+++ /dev/null
@@ -1,41 +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 { useState, useEffect } from 'react';
-import type { SavedObjectAttributes } from '@kbn/securitysolution-io-ts-alerting-types';
-import { useKibana } from '../../../common/lib/kibana';
-
-const DASHBOARD_REQUEST_BODY_SEARCH = '"Drilldown of Host Risk Score"';
-export const DASHBOARD_REQUEST_BODY = {
- type: 'dashboard',
- search: DASHBOARD_REQUEST_BODY_SEARCH,
- fields: ['title'],
-};
-
-export const useRiskyHostsDashboardId = () => {
- const savedObjectsClient = useKibana().services.savedObjects.client;
- const [dashboardId, setDashboardId] = useState();
-
- useEffect(() => {
- if (savedObjectsClient) {
- savedObjectsClient.find(DASHBOARD_REQUEST_BODY).then(
- async (DashboardsSO?: {
- savedObjects?: Array<{
- attributes?: SavedObjectAttributes;
- id?: string;
- }>;
- }) => {
- if (DashboardsSO?.savedObjects?.length) {
- setDashboardId(DashboardsSO.savedObjects[0].id);
- }
- }
- );
- }
- }, [savedObjectsClient]);
-
- return dashboardId;
-};
diff --git a/x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_links.tsx b/x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_links.tsx
deleted file mode 100644
index bf09bb56bb6f4..0000000000000
--- a/x-pack/plugins/security_solution/public/overview/containers/overview_risky_host_links/use_risky_hosts_dashboard_links.tsx
+++ /dev/null
@@ -1,73 +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 { useState, useEffect } from 'react';
-import { useKibana } from '../../../common/lib/kibana';
-import type { LinkPanelListItem } from '../../components/link_panel';
-import { useRiskyHostsDashboardId } from './use_risky_hosts_dashboard_id';
-
-export const useRiskyHostsDashboardLinks = (
- to: string,
- from: string,
- listItems: LinkPanelListItem[]
-) => {
- const { dashboard } = useKibana().services;
-
- const dashboardId = useRiskyHostsDashboardId();
- const [listItemsWithLinks, setListItemsWithLinks] = useState([]);
-
- useEffect(() => {
- let cancelled = false;
- const createLinks = async () => {
- if (dashboard?.locator && dashboardId) {
- const dashboardUrls = await Promise.all(
- listItems.reduce(
- (acc: Array>, listItem) =>
- dashboard && dashboard.locator
- ? [
- ...acc,
- dashboard.locator.getUrl({
- dashboardId,
- timeRange: {
- to,
- from,
- },
- filters: [
- {
- meta: {
- alias: null,
- disabled: false,
- negate: false,
- },
- query: { match_phrase: { 'host.name': listItem.title } },
- },
- ],
- }),
- ]
- : acc,
- []
- )
- );
- if (!cancelled && dashboardUrls.length) {
- setListItemsWithLinks(
- listItems.map((item, i) => ({
- ...item,
- path: dashboardUrls[i],
- }))
- );
- }
- } else {
- setListItemsWithLinks(listItems);
- }
- };
- createLinks();
- return () => {
- cancelled = true;
- };
- }, [dashboard, dashboardId, from, listItems, to]);
-
- return { listItemsWithLinks };
-};
diff --git a/x-pack/plugins/security_solution/public/overview/pages/overview.tsx b/x-pack/plugins/security_solution/public/overview/pages/overview.tsx
index 2e3aa7c4d8d28..6cccf353e4b1c 100644
--- a/x-pack/plugins/security_solution/public/overview/pages/overview.tsx
+++ b/x-pack/plugins/security_solution/public/overview/pages/overview.tsx
@@ -30,9 +30,7 @@ import { useDeepEqualSelector } from '../../common/hooks/use_selector';
import { ThreatIntelLinkPanel } from '../components/overview_cti_links';
import { useAllTiDataSources } from '../containers/overview_cti_links/use_all_ti_data_sources';
import { useUserPrivileges } from '../../common/components/user_privileges';
-import { RiskyHostLinks } from '../components/overview_risky_host_links';
import { useAlertsPrivileges } from '../../detections/containers/detection_engine/alerts/use_alerts_privileges';
-import { useIsExperimentalFeatureEnabled } from '../../common/hooks/use_experimental_features';
import { LandingPageComponent } from '../../common/components/landing_page';
const OverviewComponent = () => {
@@ -68,15 +66,6 @@ const OverviewComponent = () => {
const { hasIndexRead, hasKibanaREAD } = useAlertsPrivileges();
const { tiDataSources: allTiDataSources, isInitiallyLoaded: isTiLoaded } = useAllTiDataSources();
- const riskyHostsEnabled = useIsExperimentalFeatureEnabled('riskyHostsEnabled');
-
- const timerange = useMemo(
- () => ({
- from,
- to,
- }),
- [from, to]
- );
return (
<>
{indicesExist ? (
@@ -146,15 +135,6 @@ const OverviewComponent = () => {
/>
)}
-
- {riskyHostsEnabled && (
-
- )}
-
From 6d48a384837b71e3fd6b1f871b36d37dac5a0f96 Mon Sep 17 00:00:00 2001
From: Pablo Neves Machado
Date: Thu, 8 Sep 2022 10:51:36 +0200
Subject: [PATCH 2/2] Update i18n
---
x-pack/plugins/translations/translations/fr-FR.json | 11 -----------
x-pack/plugins/translations/translations/ja-JP.json | 11 -----------
x-pack/plugins/translations/translations/zh-CN.json | 11 -----------
3 files changed, 33 deletions(-)
diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json
index 3f545e9c87229..51169089a41a2 100644
--- a/x-pack/plugins/translations/translations/fr-FR.json
+++ b/x-pack/plugins/translations/translations/fr-FR.json
@@ -25517,7 +25517,6 @@
"xpack.securitySolution.overview.ctiDashboardSubtitle": "Affichage : {totalCount} {totalCount, plural, one {indicateur} other {indicateurs}}",
"xpack.securitySolution.overview.overviewHost.hostsSubtitle": "Affichage de : {formattedHostEventsCount} {hostEventsCount, plural, one {événement} other {événements}}",
"xpack.securitySolution.overview.overviewNetwork.networkSubtitle": "Affichage de : {formattedNetworkEventsCount} {networkEventsCount, plural, one {événement} other {événements}}",
- "xpack.securitySolution.overview.riskyHostsDashboardSubtitle": "Affichage : {totalCount} {totalCount, plural, one {hôte} other {hôtes}}",
"xpack.securitySolution.overview.topNLabel": "Premiers {fieldName}",
"xpack.securitySolution.pages.common.updateAlertStatusFailed": "Impossible de mettre à jour { conflicts } {conflicts, plural, =1 {alerte} other {alertes}}.",
"xpack.securitySolution.pages.common.updateAlertStatusFailedDetailed": "{ updated } {updated, plural, =1 {alerte a été mise à jour} other {alertes ont été mises à jour}} correctement, mais { conflicts } n'ont pas pu être mis à jour\n car { conflicts, plural, =1 {elle était} other {elles étaient}} déjà en cours de modification.",
@@ -28592,7 +28591,6 @@
"xpack.securitySolution.overview.ctiDashboardOtherDatasourceTitle": "Autres",
"xpack.securitySolution.overview.ctiDashboardTitle": "Threat Intelligence",
"xpack.securitySolution.overview.ctiViewDasboard": "Afficher le tableau de bord",
- "xpack.securitySolution.overview.enableRiskScorePopoverTitle": "Les alertes doivent être disponibles avant d'activer le module",
"xpack.securitySolution.overview.endgameDnsTitle": "DNS",
"xpack.securitySolution.overview.endgameFileTitle": "Fichier",
"xpack.securitySolution.overview.endgameImageLoadTitle": "Chargement de la page",
@@ -28618,7 +28616,6 @@
"xpack.securitySolution.overview.hostStatGroupFilebeat": "Filebeat",
"xpack.securitySolution.overview.hostStatGroupWinlogbeat": "Winlogbeat",
"xpack.securitySolution.overview.hostsTitle": "Événements d'hôte",
- "xpack.securitySolution.overview.importDasboard": "Importer un tableau de bord",
"xpack.securitySolution.overview.landingCards.box.cloudCard.desc": "Évaluez votre niveau de cloud et protégez vos charges de travail contre les attaques.",
"xpack.securitySolution.overview.landingCards.box.cloudCard.title": "Protection cloud de bout en bout",
"xpack.securitySolution.overview.landingCards.box.endpoint.desc": "Prévention, collecte, détection et réponse, le tout avec Elastic Agent.",
@@ -28641,14 +28638,6 @@
"xpack.securitySolution.overview.packetBeatFlowTitle": "Flux",
"xpack.securitySolution.overview.packetbeatTLSTitle": "TLS",
"xpack.securitySolution.overview.recentTimelinesSidebarTitle": "Chronologies récentes",
- "xpack.securitySolution.overview.riskyHostsDashboardDangerPanelButton": "Activer via Dev Tools",
- "xpack.securitySolution.overview.riskyHostsDashboardDangerPanelTitle": "Pas de données de score de risque de l'hôte",
- "xpack.securitySolution.overview.riskyHostsDashboardEnableThreatIntel": "Vous devez activer le module de risque des hôtes pour visualiser les hôtes à risque.",
- "xpack.securitySolution.overview.riskyHostsDashboardLearnMoreButton": "En savoir plus",
- "xpack.securitySolution.overview.riskyHostsDashboardTitle": "Scores de risque de l'hôte actuel",
- "xpack.securitySolution.overview.riskyHostsDashboardWarningPanelBody": "Nous n'avons détecté aucune donnée de score de risque de l'hôte provenant des hôtes de votre environnement pour la plage temporelle sélectionnée.",
- "xpack.securitySolution.overview.riskyHostsDashboardWarningPanelTitle": "Aucune donnée de score de risque de l'hôte disponible pour l'affichage",
- "xpack.securitySolution.overview.riskyHostsSource": "Source",
"xpack.securitySolution.overview.signalCountTitle": "Tendance des alertes",
"xpack.securitySolution.overview.viewAlertsButtonLabel": "Afficher les alertes",
"xpack.securitySolution.overview.viewEventsButtonLabel": "Afficher les événements",
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 75b6e829bd3e7..b8f6e6d027627 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -25494,7 +25494,6 @@
"xpack.securitySolution.overview.ctiDashboardSubtitle": "{totalCount} {totalCount, plural, other {個の指標}}を表示しています",
"xpack.securitySolution.overview.overviewHost.hostsSubtitle": "表示中:{formattedHostEventsCount} {hostEventsCount, plural, other {イベント}}",
"xpack.securitySolution.overview.overviewNetwork.networkSubtitle": "表示中:{formattedNetworkEventsCount} {networkEventsCount, plural, other {イベント}}",
- "xpack.securitySolution.overview.riskyHostsDashboardSubtitle": "{totalCount} {totalCount, plural, other {個のホスト}}を表示しています",
"xpack.securitySolution.overview.topNLabel": "トップ{fieldName}",
"xpack.securitySolution.pages.common.updateAlertStatusFailed": "{ conflicts } {conflicts, plural, other {アラート}}を更新できませんでした。",
"xpack.securitySolution.pages.common.updateAlertStatusFailedDetailed": "{ updated } {updated, plural, other {アラート}}が正常に更新されましたが、{ conflicts }は更新できませんでした。\n { conflicts, plural, other {}}すでに修正されています。",
@@ -28568,7 +28567,6 @@
"xpack.securitySolution.overview.ctiDashboardOtherDatasourceTitle": "その他",
"xpack.securitySolution.overview.ctiDashboardTitle": "脅威インテリジェンス",
"xpack.securitySolution.overview.ctiViewDasboard": "ダッシュボードを表示",
- "xpack.securitySolution.overview.enableRiskScorePopoverTitle": "モジュールを有効にする前に、アラートが使用可能でなければなりません",
"xpack.securitySolution.overview.endgameDnsTitle": "DNS",
"xpack.securitySolution.overview.endgameFileTitle": "ファイル",
"xpack.securitySolution.overview.endgameImageLoadTitle": "画像読み込み",
@@ -28594,7 +28592,6 @@
"xpack.securitySolution.overview.hostStatGroupFilebeat": "Filebeat",
"xpack.securitySolution.overview.hostStatGroupWinlogbeat": "Winlogbeat",
"xpack.securitySolution.overview.hostsTitle": "ホストイベント",
- "xpack.securitySolution.overview.importDasboard": "ダッシュボードをインポート",
"xpack.securitySolution.overview.landingCards.box.cloudCard.desc": "クラウド態勢を評価し、ワークロードを攻撃から保護します。",
"xpack.securitySolution.overview.landingCards.box.cloudCard.title": "エンドツーエンドのクラウド保護",
"xpack.securitySolution.overview.landingCards.box.endpoint.desc": "防御から収集、検知、対応まで実行する、Elastic Agent。",
@@ -28617,14 +28614,6 @@
"xpack.securitySolution.overview.packetBeatFlowTitle": "フロー",
"xpack.securitySolution.overview.packetbeatTLSTitle": "TLS",
"xpack.securitySolution.overview.recentTimelinesSidebarTitle": "最近のタイムライン",
- "xpack.securitySolution.overview.riskyHostsDashboardDangerPanelButton": "開発ツールで有効化",
- "xpack.securitySolution.overview.riskyHostsDashboardDangerPanelTitle": "ホストリスクスコアデータがありません",
- "xpack.securitySolution.overview.riskyHostsDashboardEnableThreatIntel": "リスクがあるホストを表示するには、ホストリスクモジュールを有効化する必要があります。",
- "xpack.securitySolution.overview.riskyHostsDashboardLearnMoreButton": "詳細情報",
- "xpack.securitySolution.overview.riskyHostsDashboardTitle": "現在のホストリスクスコア",
- "xpack.securitySolution.overview.riskyHostsDashboardWarningPanelBody": "選択した期間では、ご使用の環境のホストからホストリスクスコアデータが検出されませんでした。",
- "xpack.securitySolution.overview.riskyHostsDashboardWarningPanelTitle": "表示するホストリスクスコアデータがありません",
- "xpack.securitySolution.overview.riskyHostsSource": "送信元",
"xpack.securitySolution.overview.signalCountTitle": "アラート傾向",
"xpack.securitySolution.overview.viewAlertsButtonLabel": "アラートを表示",
"xpack.securitySolution.overview.viewEventsButtonLabel": "イベントを表示",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index a1246cc1fa749..3bc364d43c1b9 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -25525,7 +25525,6 @@
"xpack.securitySolution.overview.ctiDashboardSubtitle": "正在显示:{totalCount} 个{totalCount, plural, other {指标}}",
"xpack.securitySolution.overview.overviewHost.hostsSubtitle": "正在显示:{formattedHostEventsCount} 个{hostEventsCount, plural, other {事件}}",
"xpack.securitySolution.overview.overviewNetwork.networkSubtitle": "正在显示:{formattedNetworkEventsCount} 个{networkEventsCount, plural, other {事件}}",
- "xpack.securitySolution.overview.riskyHostsDashboardSubtitle": "正在显示:{totalCount} 台{totalCount, plural, other {主机}}",
"xpack.securitySolution.overview.topNLabel": "排名靠前的{fieldName}",
"xpack.securitySolution.pages.common.updateAlertStatusFailed": "无法更新{ conflicts } 个{conflicts, plural, other {告警}}。",
"xpack.securitySolution.pages.common.updateAlertStatusFailedDetailed": "{ updated } 个{updated, plural, other {告警}}已成功更新,但是 { conflicts } 个无法更新,\n 因为{ conflicts, plural, other {其}}已被修改。",
@@ -28599,7 +28598,6 @@
"xpack.securitySolution.overview.ctiDashboardOtherDatasourceTitle": "其他",
"xpack.securitySolution.overview.ctiDashboardTitle": "威胁情报",
"xpack.securitySolution.overview.ctiViewDasboard": "查看仪表板",
- "xpack.securitySolution.overview.enableRiskScorePopoverTitle": "启用模块之前,告警需要处于可用状态",
"xpack.securitySolution.overview.endgameDnsTitle": "DNS",
"xpack.securitySolution.overview.endgameFileTitle": "文件",
"xpack.securitySolution.overview.endgameImageLoadTitle": "映像加载",
@@ -28625,7 +28623,6 @@
"xpack.securitySolution.overview.hostStatGroupFilebeat": "Filebeat",
"xpack.securitySolution.overview.hostStatGroupWinlogbeat": "Winlogbeat",
"xpack.securitySolution.overview.hostsTitle": "主机事件",
- "xpack.securitySolution.overview.importDasboard": "导入仪表板",
"xpack.securitySolution.overview.landingCards.box.cloudCard.desc": "评估您的云态势并防止工作负载受到攻击。",
"xpack.securitySolution.overview.landingCards.box.cloudCard.title": "端到端云防护",
"xpack.securitySolution.overview.landingCards.box.endpoint.desc": "防御、收集、检测和响应 — 所有这些活动均可通过 Elastic 代理来实现。",
@@ -28648,14 +28645,6 @@
"xpack.securitySolution.overview.packetBeatFlowTitle": "流",
"xpack.securitySolution.overview.packetbeatTLSTitle": "TLS",
"xpack.securitySolution.overview.recentTimelinesSidebarTitle": "最近的时间线",
- "xpack.securitySolution.overview.riskyHostsDashboardDangerPanelButton": "通过开发工具启用",
- "xpack.securitySolution.overview.riskyHostsDashboardDangerPanelTitle": "无主机风险分数数据",
- "xpack.securitySolution.overview.riskyHostsDashboardEnableThreatIntel": "必须启用主机风险模块才能查看有风险主机。",
- "xpack.securitySolution.overview.riskyHostsDashboardLearnMoreButton": "了解详情",
- "xpack.securitySolution.overview.riskyHostsDashboardTitle": "当前主机风险分数",
- "xpack.securitySolution.overview.riskyHostsDashboardWarningPanelBody": "对于选定时间范围,我们尚未从您环境中的主机中检测到任何主机风险分数数据。",
- "xpack.securitySolution.overview.riskyHostsDashboardWarningPanelTitle": "没有可显示的主机风险分数数据",
- "xpack.securitySolution.overview.riskyHostsSource": "源",
"xpack.securitySolution.overview.signalCountTitle": "告警趋势",
"xpack.securitySolution.overview.viewAlertsButtonLabel": "查看告警",
"xpack.securitySolution.overview.viewEventsButtonLabel": "查看事件",