Skip to content

Commit

Permalink
[Security Solution] Fix networkTopNFlow search strategy response (#80362
Browse files Browse the repository at this point in the history
)
  • Loading branch information
patrykkopycinski authored Oct 14, 2020
1 parent c39581d commit 4debc51
Show file tree
Hide file tree
Showing 29 changed files with 327 additions and 260 deletions.
7 changes: 0 additions & 7 deletions x-pack/plugins/security_solution/common/ecs/geo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@

export interface GeoEcs {
city_name?: string[];

continent_name?: string[];

country_iso_code?: string[];

country_name?: string[];

location?: Location;

region_iso_code?: string[];

region_name?: string[];
}

export interface Location {
lon?: number[];

lat?: number[];
}
5 changes: 0 additions & 5 deletions x-pack/plugins/security_solution/common/ecs/source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ import { GeoEcs } from '../geo';

export interface SourceEcs {
bytes?: number[];

ip?: string[];

port?: number[];

domain?: string[];

geo?: GeoEcs;

packets?: number[];
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import styled from 'styled-components';
import { DragEffects, DraggableWrapper } from '../drag_and_drop/draggable_wrapper';
import { escapeDataProviderId } from '../drag_and_drop/helpers';
import { defaultToEmptyTag, getEmptyTagValue } from '../empty_value';
import { MoreRowItems, Spacer } from '../page';
import { MoreRowItems } from '../page';
import { IS_OPERATOR } from '../../../timelines/components/timeline/data_providers/data_provider';
import { Provider } from '../../../timelines/components/timeline/data_providers/provider';

Expand Down Expand Up @@ -92,12 +92,6 @@ export const getRowItemDraggables = ({
const id = escapeDataProviderId(`${idPrefix}-${attrName}-${rowItem}-${index}`);
return (
<React.Fragment key={id}>
{index !== 0 && (
<>
{','}
<Spacer />
</>
)}
<DraggableWrapper
key={id}
dataProvider={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const AnomaliesQueryTabBodyComponent: React.FC<AnomaliesQueryTabBodyProps> = ({
AnomaliesTableComponent,
flowTarget,
ip,
hostName,
indexNames,
}) => {
const { jobs } = useInstalledSecurityJobs();
Expand Down Expand Up @@ -71,6 +72,7 @@ const AnomaliesQueryTabBodyComponent: React.FC<AnomaliesQueryTabBodyProps> = ({
narrowDateRange={narrowDateRange}
flowTarget={flowTarget}
ip={ip}
hostName={hostName}
/>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ export type AnomaliesQueryTabBodyProps = QueryTabBodyProps & {
updateDateRange?: UpdateDateRange;
hideHistogramIfEmpty?: boolean;
ip?: string;
hostName?: string;
};
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,7 @@ const getAuthenticationColumns = (): AuthTableColumns => [
hideForMobile: false,
render: ({ node }) =>
getRowItemDraggables({
rowItems:
node.lastSuccess != null &&
node.lastSuccess.source != null &&
node.lastSuccess.source.ip != null
? node.lastSuccess.source.ip
: null,
rowItems: node.lastSuccess?.source?.ip || null,
attrName: 'source.ip',
idPrefix: `authentications-table-${node._id}-lastSuccessSource`,
render: (item) => <NetworkDetailsLink ip={item} />,
Expand All @@ -273,12 +268,7 @@ const getAuthenticationColumns = (): AuthTableColumns => [
hideForMobile: false,
render: ({ node }) =>
getRowItemDraggables({
rowItems:
node.lastSuccess != null &&
node.lastSuccess.host != null &&
node.lastSuccess.host.name != null
? node.lastSuccess.host.name
: null,
rowItems: node.lastSuccess?.host?.name ?? null,
attrName: 'host.name',
idPrefix: `authentications-table-${node._id}-lastSuccessfulDestination`,
render: (item) => <HostDetailsLink hostName={item} />,
Expand All @@ -301,12 +291,7 @@ const getAuthenticationColumns = (): AuthTableColumns => [
hideForMobile: false,
render: ({ node }) =>
getRowItemDraggables({
rowItems:
node.lastFailure != null &&
node.lastFailure.source != null &&
node.lastFailure.source.ip != null
? node.lastFailure.source.ip
: null,
rowItems: node.lastFailure?.source?.ip || null,
attrName: 'source.ip',
idPrefix: `authentications-table-${node._id}-lastFailureSource`,
render: (item) => <NetworkDetailsLink ip={item} />,
Expand All @@ -318,12 +303,7 @@ const getAuthenticationColumns = (): AuthTableColumns => [
hideForMobile: false,
render: ({ node }) =>
getRowItemDraggables({
rowItems:
node.lastFailure != null &&
node.lastFailure.host != null &&
node.lastFailure.host.name != null
? node.lastFailure.host.name
: null,
rowItems: node.lastFailure?.host?.name || null,
attrName: 'host.name',
idPrefix: `authentications-table-${node._id}-lastFailureDestination`,
render: (item) => <HostDetailsLink hostName={item} />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('Uncommon Process Table Component', () => {
);

expect(wrapper.find('.euiTableRow').at(2).find('.euiTableRowCell').at(3).text()).toBe(
'Host nameshello-world,hello-world-2 '
'Host nameshello-worldhello-world-2 '
);
});

Expand Down Expand Up @@ -214,7 +214,7 @@ describe('Uncommon Process Table Component', () => {
</TestProviders>
);
expect(wrapper.find('.euiTableRow').at(4).find('.euiTableRowCell').at(3).text()).toBe(
'Host nameshello-world,hello-world-2 '
'Host nameshello-worldhello-world-2 '
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,13 @@ export const EmbeddedMapComponent = ({
if (embeddable != null) {
embeddable.updateInput({ query });
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [query]);
}, [embeddable, query]);

useEffect(() => {
if (embeddable != null) {
embeddable.updateInput({ filters });
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [filters]);
}, [embeddable, filters]);

// DateRange updated useEffect
useEffect(() => {
Expand All @@ -217,8 +215,7 @@ export const EmbeddedMapComponent = ({
};
embeddable.updateInput({ timeRange });
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [startDate, endDate]);
}, [embeddable, startDate, endDate]);

return isError ? null : (
<Embeddable>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4debc51

Please sign in to comment.