diff --git a/public/pages/Correlations/components/CorrelationGraph.tsx b/public/pages/Correlations/components/CorrelationGraph.tsx index 4de34e6fc..dcbfe6eca 100644 --- a/public/pages/Correlations/components/CorrelationGraph.tsx +++ b/public/pages/Correlations/components/CorrelationGraph.tsx @@ -27,7 +27,7 @@ export const CorrelationGraph: React.FC = ({ getNetwork, }) => { return loadingData ? ( -
+
) : ( diff --git a/public/pages/Correlations/components/FindingCard.tsx b/public/pages/Correlations/components/FindingCard.tsx index fe1d3698c..2305c1de8 100644 --- a/public/pages/Correlations/components/FindingCard.tsx +++ b/public/pages/Correlations/components/FindingCard.tsx @@ -8,7 +8,6 @@ import { EuiPanel, EuiFlexGroup, EuiFlexItem, - EuiText, EuiButtonIcon, EuiSpacer, EuiBadge, @@ -42,78 +41,84 @@ export const FindingCard: React.FC = ({ finding, findings, }) => { - const correlationHeader = correlationData ? ( - <> - - - {correlationData.score} - - + const list = [ + { + title: 'Detection rule', + description: detectionRule.name, + }, + ]; + + if (finding.correlationRule) { + list.unshift({ + title: 'Correlation score', + description: finding.correlationRule.name, + }); + } + + const badgePadding = '2px 7px'; + const { text: severityText, background } = getSeverityColor(detectionRule.severity); + + const header = ( + + +
+ + {getSeverityLabel(detectionRule.severity)} + + + {getLabelFromLogType(logType)} + +
+
+ +
DataStore.findings.openFlyout(finding, findings, false)} /> - - correlationData.onInspect(id, logType)} + iconType={correlationData ? 'pin' : 'pinFilled'} + onClick={() => correlationData?.onInspect(id, logType)} + disabled={!correlationData} /> - - - Correlation score - - - ) : null; +
+
+
+ ); - const list = [ - { - title: 'Generated', - description: timestamp, - }, - { - title: 'Detection rule', - description: detectionRule.name, - }, - ]; + const attrList = ; - return ( + const relatedFindingCard = ( - {correlationHeader} - + {header} + + -
- - {getSeverityLabel(detectionRule.severity)} - - - {getLabelFromLogType(logType)} - -
+

Correlation score

+
+ + {correlationData?.score} + + + {timestamp} - {!correlationData && ( - - - DataStore.findings.openFlyout(finding, findings, false)} - /> - - - )}
- {correlationHeader ? : null} + + {attrList} +
+ ); + + return correlationData ? ( + relatedFindingCard + ) : ( + + {header} - + {attrList} ); }; diff --git a/public/pages/Correlations/containers/CorrelationsContainer.tsx b/public/pages/Correlations/containers/CorrelationsContainer.tsx index 3ef67cfe0..55dcbf747 100644 --- a/public/pages/Correlations/containers/CorrelationsContainer.tsx +++ b/public/pages/Correlations/containers/CorrelationsContainer.tsx @@ -33,6 +33,7 @@ import { EuiButton, EuiBadge, EuiFilterGroup, + EuiHorizontalRule, } from '@elastic/eui'; import { FilterItem, FilterGroup } from '../components/FilterGroup'; import { CoreServicesContext } from '../../../components/core_services'; @@ -112,7 +113,7 @@ export class Correlations extends React.Component { this.context.chrome.setBreadcrumbs([BREADCRUMBS.SECURITY_ANALYTICS, BREADCRUMBS.CORRELATIONS]); - this.updateState(); + this.updateState(true /* onMount */); this.props.onMount(); } @@ -130,8 +131,8 @@ export class Correlations extends React.Component { const { text, background } = getSeverityColor(detectionRule.severity); const tooltipContent = ( -
- +
+ {getSeverityLabel(detectionRule.severity)} - {getLabelFromLogType(logType)} + {getLabelFromLogType(logType)} {timestamp} + + Detection rule + +

{detectionRule.name}

); @@ -385,6 +390,7 @@ export class Correlations extends React.Component