Skip to content

Commit 77dee7f

Browse files
[Security Solution] fix alert flyout threat intelligence section not showing multiple values
1 parent d3fea8d commit 77dee7f

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/left/components/threat_details_view_enrichment_accordion.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
EuiAccordion,
1212
EuiFlexGroup,
1313
EuiFlexItem,
14-
EuiLink,
1514
EuiInMemoryTable,
15+
EuiLink,
1616
EuiTitle,
1717
EuiToolTip,
1818
useEuiTheme,
@@ -24,8 +24,8 @@ import type { CtiEnrichment } from '../../../../../common/search_strategy';
2424
import { QUERY_ID } from '../../shared/hooks/use_investigation_enrichment';
2525
import { InspectButton } from '../../../../common/components/inspect';
2626
import {
27-
getEnrichmentIdentifiers,
2827
buildThreatDetailsItems,
28+
getEnrichmentIdentifiers,
2929
isInvestigationTimeEnrichment,
3030
} from '../../shared/utils/threat_intelligence';
3131
import { EnrichmentButtonContent } from './threat_details_view_enrichment_button_content';
@@ -82,12 +82,19 @@ const columns: Array<EuiBasicTableColumn<ThreatDetailsRow>> = [
8282
truncateText: false,
8383
render: (description: ThreatDetailsRow['description']) => {
8484
const { fieldName, value } = description;
85-
const tooltipChild = fieldName.match(REFERENCE) ? (
85+
console.log('value', value);
86+
const renderedValue = fieldName.match(REFERENCE) ? (
8687
<EuiLink href={value} target="_blank">
8788
{value}
8889
</EuiLink>
8990
) : (
90-
<span>{value}</span>
91+
<EuiFlexGroup direction="column" gutterSize="none">
92+
{value.map((val) => (
93+
<EuiFlexItem>
94+
<span>{val}</span>
95+
</EuiFlexItem>
96+
))}
97+
</EuiFlexGroup>
9198
);
9299
return (
93100
<EuiToolTip
@@ -100,7 +107,7 @@ const columns: Array<EuiBasicTableColumn<ThreatDetailsRow>> = [
100107
</EuiFlexGroup>
101108
}
102109
>
103-
{tooltipChild}
110+
{renderedValue}
104111
</EuiToolTip>
105112
);
106113
},

x-pack/solutions/security/plugins/security_solution/public/flyout/document_details/shared/utils/threat_intelligence.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ import {
1818
} from '../../../../../common/constants';
1919
import {
2020
ENRICHMENT_TYPES,
21+
FEED_NAME,
2122
FIRST_SEEN,
2223
MATCHED_ATOMIC,
2324
MATCHED_FIELD,
2425
MATCHED_ID,
2526
MATCHED_TYPE,
26-
FEED_NAME,
2727
} from '../../../../../common/cti/constants';
2828

2929
const NESTED_OBJECT_VALUES_NOT_RENDERED = i18n.translate(
@@ -189,10 +189,10 @@ export const buildThreatDetailsItems = (enrichment: CtiEnrichment): ThreatDetail
189189
? field.replace(`${DEFAULT_INDICATOR_SOURCE_PATH}`, 'indicator')
190190
: field;
191191

192-
let value = getFirstElement(enrichment[field]);
193-
if (isObject(value)) {
192+
let value = enrichment[field];
193+
if (isObject(value) && !Array.isArray(value)) {
194194
value = NESTED_OBJECT_VALUES_NOT_RENDERED;
195195
}
196196

197-
return { title, description: { fieldName: field, value: value as string } };
197+
return { title, description: { fieldName: field, value: value as string[] } };
198198
});

0 commit comments

Comments
 (0)