Skip to content

Commit 2f70933

Browse files
authored
[SECURITY] [Timeline] Raw events not displayed (#72387) (#72462)
1 parent d5f34c8 commit 2f70933

File tree

15 files changed

+3089
-65
lines changed

15 files changed

+3089
-65
lines changed

src/plugins/home/public/application/components/__snapshots__/add_data.test.js.snap

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/home/public/application/components/add_data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ const AddDataUi = ({ apmUiEnabled, isNewKibanaInstance, intl, mlEnabled }) => {
8181
const siemData = {
8282
title: intl.formatMessage({
8383
id: 'home.addData.securitySolution.nameTitle',
84-
defaultMessage: 'Security',
84+
defaultMessage: 'SIEM + Endpoint Security',
8585
}),
8686
description: intl.formatMessage({
8787
id: 'home.addData.securitySolution.nameDescription',
8888
defaultMessage:
89-
'Centralize security events for interactive investigation in ready-to-go visualizations.',
89+
'Protect hosts, analyze security information and events, hunt threats, automate detections, and create cases.',
9090
}),
9191
ariaDescribedby: 'aria-describedby.addSiemButtonLabel',
9292
};

x-pack/plugins/security_solution/public/common/components/header_global/index.tsx

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -63,26 +63,19 @@ export const HeaderGlobal = React.memo<HeaderGlobalProps>(({ hideDetectionEngine
6363
<EuiFlexGroup alignItems="center" responsive={false}>
6464
<FlexItem grow={false}>
6565
<LinkAnchor onClick={goToOverview} href={getAppOverviewUrl(search)}>
66-
<EuiIcon aria-label={i18n.SIEM} type="logoSecurity" size="l" />
66+
<EuiIcon aria-label={i18n.SECURITY_SOLUTION} type="logoSecurity" size="l" />
6767
</LinkAnchor>
6868
</FlexItem>
6969

7070
<FlexItem component="nav">
71-
{indicesExist ? (
72-
<SiemNavigation
73-
display="condensed"
74-
navTabs={
75-
hideDetectionEngine
76-
? pickBy((_, key) => key !== SecurityPageName.detections, navTabs)
77-
: navTabs
78-
}
79-
/>
80-
) : (
81-
<SiemNavigation
82-
display="condensed"
83-
navTabs={pickBy((_, key) => key === SecurityPageName.overview, navTabs)}
84-
/>
85-
)}
71+
<SiemNavigation
72+
display="condensed"
73+
navTabs={
74+
hideDetectionEngine
75+
? pickBy((_, key) => key !== SecurityPageName.detections, navTabs)
76+
: navTabs
77+
}
78+
/>
8679
</FlexItem>
8780
</EuiFlexGroup>
8881
</FlexItem>

x-pack/plugins/security_solution/public/common/components/header_global/translations.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66

77
import { i18n } from '@kbn/i18n';
88

9-
export const SIEM = i18n.translate('xpack.securitySolution.headerGlobal.siem', {
10-
defaultMessage: 'SIEM',
11-
});
9+
export const SECURITY_SOLUTION = i18n.translate(
10+
'xpack.securitySolution.headerGlobal.securitySolution',
11+
{
12+
defaultMessage: 'Security solution',
13+
}
14+
);
1215

1316
export const BUTTON_ADD_DATA = i18n.translate('xpack.securitySolution.headerGlobal.buttonAddData', {
1417
defaultMessage: 'Add data',

x-pack/plugins/security_solution/public/common/containers/source/index.test.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { act, renderHook } from '@testing-library/react-hooks';
88

99
import { useWithSource, indicesExistOrDataTemporarilyUnavailable } from '.';
10+
import { NO_ALERT_INDEX } from '../../../../common/constants';
1011
import { mockBrowserFields, mockIndexFields, mocksSource } from './mock';
1112

1213
jest.mock('../../lib/kibana');
@@ -79,6 +80,17 @@ describe('Index Fields & Browser Fields', () => {
7980
});
8081
});
8182

83+
test('Make sure we are not querying for NO_ALERT_INDEX and it is not includes in the index pattern', async () => {
84+
const { result, waitForNextUpdate } = renderHook(() =>
85+
useWithSource('default', [NO_ALERT_INDEX])
86+
);
87+
88+
await waitForNextUpdate();
89+
return expect(result.current.indexPattern.title).toEqual(
90+
'apm-*-transaction*,auditbeat-*,endgame-*,filebeat-*,logs-*,packetbeat-*,winlogbeat-*'
91+
);
92+
});
93+
8294
describe('indicesExistOrDataTemporarilyUnavailable', () => {
8395
test('it returns true when undefined', () => {
8496
let undefVar;

x-pack/plugins/security_solution/public/common/containers/source/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useEffect, useMemo, useState } from 'react';
1111
import memoizeOne from 'memoize-one';
1212
import { IIndexPattern } from 'src/plugins/data/public';
1313

14-
import { DEFAULT_INDEX_KEY } from '../../../../common/constants';
14+
import { DEFAULT_INDEX_KEY, NO_ALERT_INDEX } from '../../../../common/constants';
1515
import { useUiSetting$ } from '../../lib/kibana';
1616

1717
import { IndexField, SourceQuery } from '../../../graphql/types';
@@ -126,8 +126,9 @@ export const useWithSource = (
126126
) => {
127127
const [configIndex] = useUiSetting$<string[]>(DEFAULT_INDEX_KEY);
128128
const defaultIndex = useMemo<string[]>(() => {
129-
if (indexToAdd != null && !isEmpty(indexToAdd)) {
130-
return onlyCheckIndexToAdd ? indexToAdd : [...configIndex, ...indexToAdd];
129+
const filterIndexAdd = (indexToAdd ?? []).filter((item) => item !== NO_ALERT_INDEX);
130+
if (!isEmpty(filterIndexAdd)) {
131+
return onlyCheckIndexToAdd ? filterIndexAdd : [...configIndex, ...filterIndexAdd];
131132
}
132133
return configIndex;
133134
}, [configIndex, indexToAdd, onlyCheckIndexToAdd]);
@@ -138,7 +139,7 @@ export const useWithSource = (
138139
errorMessage: null,
139140
indexPattern: getIndexFields(defaultIndex.join(), []),
140141
indicesExist: indicesExistOrDataTemporarilyUnavailable(undefined),
141-
loading: false,
142+
loading: true,
142143
});
143144

144145
const apolloClient = useApolloClient();
@@ -155,7 +156,7 @@ export const useWithSource = (
155156
try {
156157
const result = await apolloClient.query<SourceQuery.Query, SourceQuery.Variables>({
157158
query: sourceQuery,
158-
fetchPolicy: 'cache-first',
159+
fetchPolicy: 'network-only',
159160
variables: {
160161
sourceId,
161162
defaultIndex,

x-pack/plugins/security_solution/public/detections/components/rules/pre_packaged_rules/load_empty_prompt.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const PrePackagedRulesPromptComponent: React.FC<PrePackagedRulesPromptProps> = (
4848

4949
return (
5050
<EmptyPrompt
51-
iconType="securityAnalyticsApp"
5251
title={<h2>{i18n.PRE_BUILT_TITLE}</h2>}
5352
body={<p>{i18n.PRE_BUILT_MSG}</p>}
5453
actions={

x-pack/plugins/security_solution/public/detections/components/rules/step_rule_actions/index.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import { useKibana } from '../../../../common/lib/kibana';
3535
import { getSchema } from './schema';
3636
import * as I18n from './translations';
3737
import { APP_ID } from '../../../../../common/constants';
38-
import { SecurityPageName } from '../../../../app/types';
3938

4039
interface StepRuleActionsProps extends RuleStepProps {
4140
defaultValues?: ActionsStepRule | null;
@@ -86,16 +85,13 @@ const StepRuleActionsComponent: FC<StepRuleActionsProps> = ({
8685
schema,
8786
});
8887

89-
// TO DO need to make sure that logic is still valid
90-
const kibanaAbsoluteUrl = useMemo(() => {
91-
const url = application.getUrlForApp(`${APP_ID}:${SecurityPageName.detections}`, {
92-
absolute: true,
93-
});
94-
if (url != null && url.includes('app/security/alerts')) {
95-
return url.replace('app/security/alerts', 'app/security');
96-
}
97-
return url;
98-
}, [application]);
88+
const kibanaAbsoluteUrl = useMemo(
89+
() =>
90+
application.getUrlForApp(`${APP_ID}`, {
91+
absolute: true,
92+
}),
93+
[application]
94+
);
9995

10096
const onSubmit = useCallback(
10197
async (enabled: boolean) => {

x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules/fetch_index_patterns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const useFetchIndexPatterns = (defaultIndices: string[] = []): Return =>
7070
apolloClient
7171
.query<SourceQuery.Query, SourceQuery.Variables>({
7272
query: sourceQuery,
73-
fetchPolicy: 'cache-first',
73+
fetchPolicy: 'network-only',
7474
variables: {
7575
sourceId: 'default',
7676
defaultIndex: indices,

x-pack/plugins/security_solution/public/timelines/components/fields_browser/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,9 @@ export const StatefulFieldsBrowserComponent: React.FC<FieldBrowserProps> = ({
138138
setShow(false);
139139
}, []);
140140
// only merge in the default category if the field browser is visible
141-
const browserFieldsWithDefaultCategory = useMemo(
142-
() => (show ? mergeBrowserFieldsWithDefaultCategory(browserFields) : {}),
143-
[show, browserFields]
144-
);
141+
const browserFieldsWithDefaultCategory = useMemo(() => {
142+
return show ? mergeBrowserFieldsWithDefaultCategory(browserFields) : {};
143+
}, [show, browserFields]);
145144

146145
return (
147146
<FieldsBrowserButtonContainer data-test-subj="fields-browser-button-container">

0 commit comments

Comments
 (0)