Skip to content

Commit

Permalink
Revert process.session to process.session_leader (elastic#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
zizhouW authored Feb 22, 2022
1 parent e9170f0 commit dc4b7e7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {

export const mockEvents: ProcessEvent[] = [
{
'@timestamp': new Date('2021-11-23T15:25:04.210Z'),
'@timestamp': '2021-11-23T15:25:04.210Z',
user: {
name: '',
id: '1000',
Expand Down Expand Up @@ -50,7 +50,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z'),
start: '2021-11-23T15:25:04.210Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -74,7 +74,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z'),
start: '2021-11-23T15:25:04.210Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -98,7 +98,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z'),
start: '2021-11-23T15:25:04.210Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -122,7 +122,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z'),
start: '2021-11-23T15:25:04.210Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -136,7 +136,7 @@ export const mockEvents: ProcessEvent[] = [
args_count: 0,
args: [],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z'),
start: '2021-11-23T15:25:04.210Z',
},
event: {
action: EventAction.fork,
Expand All @@ -161,7 +161,7 @@ export const mockEvents: ProcessEvent[] = [
},
},
{
'@timestamp': new Date('2021-11-23T15:25:04.218Z'),
'@timestamp': '2021-11-23T15:25:04.218Z',
user: {
name: '',
id: '1000',
Expand Down Expand Up @@ -194,7 +194,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
start: '2021-11-23T15:25:04.218Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -218,7 +218,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
start: '2021-11-23T15:25:04.218Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -242,7 +242,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
start: '2021-11-23T15:25:04.218Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -266,7 +266,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
start: '2021-11-23T15:25:04.218Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -280,7 +280,7 @@ export const mockEvents: ProcessEvent[] = [
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
start: '2021-11-23T15:25:04.218Z',
},
event: {
action: EventAction.exec,
Expand All @@ -289,7 +289,7 @@ export const mockEvents: ProcessEvent[] = [
},
},
{
'@timestamp': new Date('2021-11-23T15:25:05.202Z'),
'@timestamp': '2021-11-23T15:25:05.202Z',
user: {
name: '',
id: '1000',
Expand Down Expand Up @@ -322,7 +322,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:05.202Z'),
start: '2021-11-23T15:25:05.202Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -346,7 +346,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:05.202Z'),
start: '2021-11-23T15:25:05.202Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -370,7 +370,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:05.202Z'),
start: '2021-11-23T15:25:05.202Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -394,7 +394,7 @@ export const mockEvents: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:05.202Z'),
start: '2021-11-23T15:25:05.202Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -404,7 +404,7 @@ export const mockEvents: ProcessEvent[] = [
},
},
},
start: new Date('2021-11-23T15:25:05.202Z'),
start: '2021-11-23T15:25:05.202Z',
name: '',
args_count: 2,
args: ['vi', 'cmd/config.ini'],
Expand Down Expand Up @@ -459,7 +459,7 @@ export const mockAlerts: ProcessEvent[] = [
uuid: '6bb22512e0e588d1a2449b61f164b216e366fba2de39e65d002ae734d71a6c38',
},
},
'@timestamp': new Date('2021-11-23T15:26:34.859Z'),
'@timestamp': '2021-11-23T15:26:34.859Z',
user: {
name: 'vagrant',
id: '1000',
Expand All @@ -484,7 +484,7 @@ export const mockAlerts: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
start: '2021-11-23T15:26:34.859Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -508,7 +508,7 @@ export const mockAlerts: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
start: '2021-11-23T15:26:34.859Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -532,7 +532,7 @@ export const mockAlerts: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
start: '2021-11-23T15:26:34.859Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -556,7 +556,7 @@ export const mockAlerts: ProcessEvent[] = [
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
start: '2021-11-23T15:26:34.859Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -570,7 +570,7 @@ export const mockAlerts: ProcessEvent[] = [
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
start: '2021-11-23T15:26:34.859Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand Down Expand Up @@ -626,7 +626,7 @@ export const mockAlerts: ProcessEvent[] = [
uuid: '2873463965b70d37ab9b2b3a90ac5a03b88e76e94ad33568285cadcefc38ed75',
},
},
'@timestamp': new Date('2021-11-23T15:26:34.860Z'),
'@timestamp': '2021-11-23T15:26:34.860Z',
user: {
name: 'vagrant',
id: '1000',
Expand All @@ -652,7 +652,7 @@ export const mockAlerts: ProcessEvent[] = [
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
start: '2021-11-23T15:26:34.860Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -676,7 +676,7 @@ export const mockAlerts: ProcessEvent[] = [
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
start: '2021-11-23T15:26:34.860Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -700,7 +700,7 @@ export const mockAlerts: ProcessEvent[] = [
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
start: '2021-11-23T15:26:34.860Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -724,7 +724,7 @@ export const mockAlerts: ProcessEvent[] = [
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
start: '2021-11-23T15:26:34.860Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand All @@ -738,7 +738,7 @@ export const mockAlerts: ProcessEvent[] = [
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
start: '2021-11-23T15:26:34.860Z',
tty: {
descriptor: 0,
type: 'char_device',
Expand Down Expand Up @@ -795,7 +795,7 @@ export const childProcessMock: Process = {
getOutput: () => '',
getDetails: () =>
({
'@timestamp': new Date('2021-11-23T15:25:05.210Z'),
'@timestamp': '2021-11-23T15:25:05.210Z',
event: {
kind: EventKind.event,
category: 'process',
Expand Down Expand Up @@ -829,7 +829,7 @@ export const childProcessMock: Process = {
interactive: true,
name: 'ls',
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:05.210Z'),
start: '2021-11-23T15:25:05.210Z',
pid: 2,
parent: {
args: ['bash'],
Expand All @@ -839,7 +839,7 @@ export const childProcessMock: Process = {
interactive: false,
name: '',
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z'),
start: '2021-11-23T15:25:04.210Z',
pid: 1,
user: {
id: '1',
Expand Down Expand Up @@ -871,7 +871,7 @@ export const processMock: Process = {
getOutput: () => '',
getDetails: () =>
({
'@timestamp': new Date('2021-11-23T15:25:04.210Z'),
'@timestamp': '2021-11-23T15:25:04.210Z',
event: {
kind: EventKind.event,
category: 'process',
Expand Down Expand Up @@ -906,7 +906,7 @@ export const processMock: Process = {
interactive: false,
name: '',
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z'),
start: '2021-11-23T15:25:04.210Z',
pid: 1,
parent: {} as ProcessFields,
session_leader: {} as ProcessFields,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ export interface ProcessFields {
export interface ProcessSelf extends Omit<ProcessFields, 'user'> {
parent: ProcessFields;
session_leader: ProcessFields;
// replacing session_leader with session as a Temporary implementation for the endpoint integration
// TODO: revert to session_leader once it's ready
session: ProcessFields;
entry_leader: ProcessFields;
group_leader: ProcessFields;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const getDetailPanelProcess = (process: Process | null) => {

processData.args = [...args];
processData.entryLeader = getDetailPanelProcessLeader(process.events[0].process.entry_leader);
processData.sessionLeader = getDetailPanelProcessLeader(process.events[0].process.session);
processData.sessionLeader = getDetailPanelProcessLeader(process.events[0].process.session_leader);
processData.groupLeader = getDetailPanelProcessLeader(process.events[0].process.group_leader);
processData.parent = getDetailPanelProcessLeader(process.events[0].process.parent);

Expand Down

0 comments on commit dc4b7e7

Please sign in to comment.