diff --git a/public/pages/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.tsx b/public/pages/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.tsx index 93042ddc..2266fdf6 100644 --- a/public/pages/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.tsx +++ b/public/pages/CreateDetector/components/ConfigureAlerts/components/AlertCondition/AlertConditionPanel.tsx @@ -73,6 +73,22 @@ export default class AlertConditionPanel extends Component< this.prepareMessage(false /* updateMessage */, true /* onMount */); } + componentDidUpdate( + prevProps: Readonly, + _prevState: Readonly + ): void { + if (prevProps.rulesOptions !== this.props.rulesOptions) { + const selectedNames: EuiComboBoxOptionOption[] = []; + this.props.alertCondition.ids.forEach((ruleId) => { + const rule = this.props.rulesOptions.find((option) => option.id === ruleId); + if (rule) { + selectedNames.push({ label: rule.name, value: ruleId }); + } + }); + this.setState({ selectedNames }); + } + } + onDetectionTypeChange(detectionType: 'rules' | 'threat_intel', enabled: boolean) { const detectionTypes = new Set(this.props.alertCondition.detection_types); enabled ? detectionTypes.add(detectionType) : detectionTypes.delete(detectionType); diff --git a/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.tsx b/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.tsx index 683397fd..01ab4393 100644 --- a/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.tsx +++ b/public/pages/Detectors/components/DetectorBasicDetailsView/DetectorBasicDetailsView.tsx @@ -3,14 +3,20 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { EuiSmallButton, EuiSpacer, EuiLink, EuiIcon, EuiText } from '@elastic/eui'; +import { EuiSmallButton, EuiSpacer, EuiLink, EuiIcon, EuiText, EuiCallOut } from '@elastic/eui'; import React from 'react'; import { ContentPanel } from '../../../../components/ContentPanel'; -import { createTextDetailsGroup, parseSchedule } from '../../../../utils/helpers'; +import { createTextDetailsGroup, navigateToRoute, parseSchedule } from '../../../../utils/helpers'; import moment from 'moment'; -import { DEFAULT_EMPTY_DATA, logTypesWithDashboards } from '../../../../utils/constants'; +import { + DEFAULT_EMPTY_DATA, + logTypesWithDashboards, + ROUTES, + THREAT_INTEL_NAV_ID, +} from '../../../../utils/constants'; import { Detector } from '../../../../../types'; import { getLogTypeLabel } from '../../../LogTypes/utils/helpers'; +import { RouteComponentProps } from 'react-router-dom'; export interface DetectorBasicDetailsViewProps { detector: Detector; @@ -20,6 +26,7 @@ export interface DetectorBasicDetailsViewProps { last_update_time?: number; onEditClicked: () => void; isEditable: boolean; + history: RouteComponentProps['history']; } export const DetectorBasicDetailsView: React.FC = ({ @@ -29,6 +36,7 @@ export const DetectorBasicDetailsView: React.FC = rulesCanFold, children, dashboardId, + history, onEditClicked, isEditable = true, }) => { @@ -51,7 +59,10 @@ export const DetectorBasicDetailsView: React.FC = actions={ isEditable ? [ - + Edit , ] @@ -101,6 +112,27 @@ export const DetectorBasicDetailsView: React.FC = {createTextDetailsGroup([ { label: 'Threat intelligence', content: threat_intel_enabled ? 'Enabled' : 'Disabled' }, ])} + {threat_intel_enabled && ( + +

+ To match multiple data sources against known indicators of compromise we recommend + to configure logs scan with threat intel sources on the + + navigateToRoute(history, THREAT_INTEL_NAV_ID, ROUTES.THREAT_INTEL_OVERVIEW) + } + > + Threat intelligence + {' '} + page and removing threat intel feeds from the detectors. +

+ + } + /> + )} {rulesCanFold ? children : null} ); diff --git a/public/pages/Detectors/containers/DetectorDetailsView/DetectorDetailsView.tsx b/public/pages/Detectors/containers/DetectorDetailsView/DetectorDetailsView.tsx index e3f5cb14..64596238 100644 --- a/public/pages/Detectors/containers/DetectorDetailsView/DetectorDetailsView.tsx +++ b/public/pages/Detectors/containers/DetectorDetailsView/DetectorDetailsView.tsx @@ -10,6 +10,7 @@ import { DetectorRulesView } from '../../components/DetectorRulesView/DetectorRu import { RuleItem } from '../../../CreateDetector/components/DefineDetector/components/DetectionRules/types/interfaces'; import { NotificationsStart } from 'opensearch-dashboards/public'; import { Detector } from '../../../../../types'; +import { RouteComponentProps } from 'react-router-dom'; export interface DetectorDetailsViewProps { detector: Detector; @@ -21,6 +22,7 @@ export interface DetectorDetailsViewProps { editBasicDetails: () => void; editDetectorRules: (enabledRules: RuleItem[], allRuleItems: RuleItem[]) => void; isEditable?: boolean; + history: RouteComponentProps['history']; } export interface DetectorDetailsViewState {} diff --git a/public/pages/Overview/containers/Overview/Overview.tsx b/public/pages/Overview/containers/Overview/Overview.tsx index 398fe695..0a478230 100644 --- a/public/pages/Overview/containers/Overview/Overview.tsx +++ b/public/pages/Overview/containers/Overview/Overview.tsx @@ -9,9 +9,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiPopover, - EuiSuperDatePicker, - EuiTitle, - EuiSpacer, EuiSmallButton, EuiCard, EuiPanel, @@ -107,7 +104,11 @@ export const Overview: React.FC = (props) => { const isSecurityAnalyticsUseCase = currentNavGroup?.id === SECURITY_ANALYTICS_USE_CASE_ID; useEffect(() => { - setBreadcrumbs(isSecurityAnalyticsUseCase ? [ BREADCRUMBS.OVERVIEW] : [{...BREADCRUMBS.OVERVIEW, text: 'Security Analytics overview'}]); + setBreadcrumbs( + isSecurityAnalyticsUseCase + ? [BREADCRUMBS.OVERVIEW] + : [{ ...BREADCRUMBS.OVERVIEW, text: 'Security Analytics overview' }] + ); overviewViewModelActor.registerRefreshHandler(updateState, true /* allowPartialResults */); overviewViewModelActor.registerRefreshHandler( onLoadingComplete, @@ -273,7 +274,13 @@ export const Overview: React.FC = (props) => { {getOverviewsCardsProps().map((p, idx) => ( - + ))}