Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Resolver] add comments. #78301

Merged
merged 1 commit into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions x-pack/plugins/security_solution/common/endpoint/models/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ export function timestampAsDateSafeVersion(event: TimestampFields): Date | undef
}
}

/**
* The @timestamp ECS field
*/
export function eventTimestamp(event: SafeResolverEvent): string | undefined | number {
return firstNonNullValue(event['@timestamp']);
}
Expand Down Expand Up @@ -213,12 +216,18 @@ export function eventSequence(event: EventSequenceFields): number | undefined {
return firstNonNullValue(event.event?.sequence);
}

/**
* The event.id ECS field.
*/
export function eventIDSafeVersion(event: SafeResolverEvent): number | undefined | string {
return firstNonNullValue(
isLegacyEventSafeVersion(event) ? event.endgame?.serial_event_id : event.event?.id
);
}

/**
* The event.entity_id field.
*/
export function entityId(event: ResolverEvent): string {
if (isLegacyEvent(event)) {
return event.endgame.unique_pid ? String(event.endgame.unique_pid) : '';
Expand Down Expand Up @@ -258,6 +267,9 @@ export function entityIDSafeVersion(event: EntityIDFields): string | undefined {
}
}

/**
* The process.parent.entity_id ECS field.
*/
export function parentEntityId(event: ResolverEvent): string | undefined {
if (isLegacyEvent(event)) {
return event.endgame.unique_ppid ? String(event.endgame.unique_ppid) : undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export const relatedEventCountByType: (
const stats = statsMap(nodeID);
if (stats) {
const value = Object.prototype.hasOwnProperty.call(stats.events.byCategory, eventType);
if (typeof value === 'number') {
if (typeof value === 'number' && Number.isFinite(value)) {
return value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,32 @@ import { EuiBreadcrumbs } from '@elastic/eui';
import styled from 'styled-components';
import { EuiDescriptionList } from '@elastic/eui';

/**
* Used by the nodeDetail view to show attributes of the related events.
*/
export const StyledDescriptionList = styled(EuiDescriptionList)`
&.euiDescriptionList.euiDescriptionList--column dt.euiDescriptionList__title.desc-title {
max-width: 10em;
}
`;

/**
* Used by the nodeDetail view for the label of the node.
*/
export const StyledTitle = styled('h4')`
overflow-wrap: break-word;
`;

/**
* Used for a 'BETA' badge in the breadcrumbs of each panel.
*/
export const BetaHeader = styled(`header`)`
margin-bottom: 1em;
`;

/**
* Styled version of EuiBreadcrumbs that is used by the breadcrumbs in each panel.
*/
export const ThemedBreadcrumbs = styled(EuiBreadcrumbs)<{ background: string; text: string }>`
&.euiBreadcrumbs {
background-color: ${(props) => props.background};
Expand All @@ -38,20 +50,32 @@ export const ThemedBreadcrumbs = styled(EuiBreadcrumbs)<{ background: string; te
}
`;

/**
* Used in the links to nodes on the node list panel.
*/
export const StyledButtonTextContainer = styled.div`
align-items: center;
display: flex;
flex-direction: row;
`;

/**
* Used in the node list panel to call out the event that is represented by the databaseDocumentID.
*/
export const StyledAnalyzedEvent = styled.div`
color: ${(props) => props.color};
font-size: 10.5px;
font-weight: 700;
`;

/**
* Used to style the node name in the node list panel view.
*/
export const StyledLabelTitle = styled.div``;

/**
* Used by the node list view. Wraps the title of the node and the 'Analyzed event' marker.
*/
export const StyledLabelContainer = styled.div`
display: inline-block;
flex: 3;
Expand Down