forked from johnjohnsp1/capsule8
/
event.pb.go
1556 lines (1414 loc) · 57.1 KB
/
event.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: capsule8/api/v0/event.proto
package v0
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type ContainerEventType int32
const (
ContainerEventType_CONTAINER_EVENT_TYPE_UNKNOWN ContainerEventType = 0
ContainerEventType_CONTAINER_EVENT_TYPE_CREATED ContainerEventType = 1
ContainerEventType_CONTAINER_EVENT_TYPE_RUNNING ContainerEventType = 2
ContainerEventType_CONTAINER_EVENT_TYPE_EXITED ContainerEventType = 3
ContainerEventType_CONTAINER_EVENT_TYPE_DESTROYED ContainerEventType = 4
)
var ContainerEventType_name = map[int32]string{
0: "CONTAINER_EVENT_TYPE_UNKNOWN",
1: "CONTAINER_EVENT_TYPE_CREATED",
2: "CONTAINER_EVENT_TYPE_RUNNING",
3: "CONTAINER_EVENT_TYPE_EXITED",
4: "CONTAINER_EVENT_TYPE_DESTROYED",
}
var ContainerEventType_value = map[string]int32{
"CONTAINER_EVENT_TYPE_UNKNOWN": 0,
"CONTAINER_EVENT_TYPE_CREATED": 1,
"CONTAINER_EVENT_TYPE_RUNNING": 2,
"CONTAINER_EVENT_TYPE_EXITED": 3,
"CONTAINER_EVENT_TYPE_DESTROYED": 4,
}
func (x ContainerEventType) String() string {
return proto.EnumName(ContainerEventType_name, int32(x))
}
func (ContainerEventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
// Possible ProcessEvent types
type ProcessEventType int32
const (
// The type of event is unknown
ProcessEventType_PROCESS_EVENT_TYPE_UNKNOWN ProcessEventType = 0
// The event is a process fork event
ProcessEventType_PROCESS_EVENT_TYPE_FORK ProcessEventType = 1
// The event is a process exec event
ProcessEventType_PROCESS_EVENT_TYPE_EXEC ProcessEventType = 2
// The event is a process exit event
ProcessEventType_PROCESS_EVENT_TYPE_EXIT ProcessEventType = 3
)
var ProcessEventType_name = map[int32]string{
0: "PROCESS_EVENT_TYPE_UNKNOWN",
1: "PROCESS_EVENT_TYPE_FORK",
2: "PROCESS_EVENT_TYPE_EXEC",
3: "PROCESS_EVENT_TYPE_EXIT",
}
var ProcessEventType_value = map[string]int32{
"PROCESS_EVENT_TYPE_UNKNOWN": 0,
"PROCESS_EVENT_TYPE_FORK": 1,
"PROCESS_EVENT_TYPE_EXEC": 2,
"PROCESS_EVENT_TYPE_EXIT": 3,
}
func (x ProcessEventType) String() string {
return proto.EnumName(ProcessEventType_name, int32(x))
}
func (ProcessEventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
// Possible SyscallEvent types
type SyscallEventType int32
const (
// The type of event is unknown
SyscallEventType_SYSCALL_EVENT_TYPE_UNKNOWN SyscallEventType = 0
// The event is a syscall enter event
SyscallEventType_SYSCALL_EVENT_TYPE_ENTER SyscallEventType = 1
// The event is a syscall exit event
SyscallEventType_SYSCALL_EVENT_TYPE_EXIT SyscallEventType = 2
)
var SyscallEventType_name = map[int32]string{
0: "SYSCALL_EVENT_TYPE_UNKNOWN",
1: "SYSCALL_EVENT_TYPE_ENTER",
2: "SYSCALL_EVENT_TYPE_EXIT",
}
var SyscallEventType_value = map[string]int32{
"SYSCALL_EVENT_TYPE_UNKNOWN": 0,
"SYSCALL_EVENT_TYPE_ENTER": 1,
"SYSCALL_EVENT_TYPE_EXIT": 2,
}
func (x SyscallEventType) String() string {
return proto.EnumName(SyscallEventType_name, int32(x))
}
func (SyscallEventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
// Possible FileEvent types
type FileEventType int32
const (
// The type of event is unknown
FileEventType_FILE_EVENT_TYPE_UNKNOWN FileEventType = 0
// The event is a file open event
FileEventType_FILE_EVENT_TYPE_OPEN FileEventType = 1
)
var FileEventType_name = map[int32]string{
0: "FILE_EVENT_TYPE_UNKNOWN",
1: "FILE_EVENT_TYPE_OPEN",
}
var FileEventType_value = map[string]int32{
"FILE_EVENT_TYPE_UNKNOWN": 0,
"FILE_EVENT_TYPE_OPEN": 1,
}
func (x FileEventType) String() string {
return proto.EnumName(FileEventType_name, int32(x))
}
func (FileEventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
// Possible KernelFunctionCallEvent types
type KernelFunctionCallEventType int32
const (
// The type of event is unknown
KernelFunctionCallEventType_KERNEL_FUNCTION_CALL_EVENT_TYPE_UNKNOWN KernelFunctionCallEventType = 0
// The event is a kernel function being entered.
KernelFunctionCallEventType_KERNEL_FUNCTION_CALL_EVENT_TYPE_ENTER KernelFunctionCallEventType = 1
// The event is a kernel function being exited.
KernelFunctionCallEventType_KERNEL_FUNCTION_CALL_EVENT_TYPE_EXIT KernelFunctionCallEventType = 2
)
var KernelFunctionCallEventType_name = map[int32]string{
0: "KERNEL_FUNCTION_CALL_EVENT_TYPE_UNKNOWN",
1: "KERNEL_FUNCTION_CALL_EVENT_TYPE_ENTER",
2: "KERNEL_FUNCTION_CALL_EVENT_TYPE_EXIT",
}
var KernelFunctionCallEventType_value = map[string]int32{
"KERNEL_FUNCTION_CALL_EVENT_TYPE_UNKNOWN": 0,
"KERNEL_FUNCTION_CALL_EVENT_TYPE_ENTER": 1,
"KERNEL_FUNCTION_CALL_EVENT_TYPE_EXIT": 2,
}
func (x KernelFunctionCallEventType) String() string {
return proto.EnumName(KernelFunctionCallEventType_name, int32(x))
}
func (KernelFunctionCallEventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{4} }
// Possible network event types
type NetworkEventType int32
const (
// The type of event is unknown
NetworkEventType_NETWORK_EVENT_TYPE_UNKNOWN NetworkEventType = 0
// The event is an attempt to connect to an address
NetworkEventType_NETWORK_EVENT_TYPE_CONNECT_ATTEMPT NetworkEventType = 1
// The event is the result of an attempt to connect to an address
NetworkEventType_NETWORK_EVENT_TYPE_CONNECT_RESULT NetworkEventType = 2
// The event is an attempt to bind to a local address
NetworkEventType_NETWORK_EVENT_TYPE_BIND_ATTEMPT NetworkEventType = 3
// The event is the result of an attempt to bind to a local address
NetworkEventType_NETWORK_EVENT_TYPE_BIND_RESULT NetworkEventType = 4
// The event is an attempt to listen for connections
NetworkEventType_NETWORK_EVENT_TYPE_LISTEN_ATTEMPT NetworkEventType = 5
// The event is the result of an attempt to listen for connections
NetworkEventType_NETWORK_EVENT_TYPE_LISTEN_RESULT NetworkEventType = 6
// The event is an attempt to accept an incoming connection
NetworkEventType_NETWORK_EVENT_TYPE_ACCEPT_ATTEMPT NetworkEventType = 7
// The event is the result of an attempt to accept an incoming
// connection
NetworkEventType_NETWORK_EVENT_TYPE_ACCEPT_RESULT NetworkEventType = 8
// The event is an attempt to send data to a specific address
NetworkEventType_NETWORK_EVENT_TYPE_SENDTO_ATTEMPT NetworkEventType = 9
// The event is the result of an attempt to send data to a specific
// address
NetworkEventType_NETWORK_EVENT_TYPE_SENDTO_RESULT NetworkEventType = 10
// The event is an attempt to receive data from a specific address
NetworkEventType_NETWORK_EVENT_TYPE_RECVFROM_ATTEMPT NetworkEventType = 11
// The event is the result of an attempt to receive data from a
// specific address
NetworkEventType_NETWORK_EVENT_TYPE_RECVFROM_RESULT NetworkEventType = 12
)
var NetworkEventType_name = map[int32]string{
0: "NETWORK_EVENT_TYPE_UNKNOWN",
1: "NETWORK_EVENT_TYPE_CONNECT_ATTEMPT",
2: "NETWORK_EVENT_TYPE_CONNECT_RESULT",
3: "NETWORK_EVENT_TYPE_BIND_ATTEMPT",
4: "NETWORK_EVENT_TYPE_BIND_RESULT",
5: "NETWORK_EVENT_TYPE_LISTEN_ATTEMPT",
6: "NETWORK_EVENT_TYPE_LISTEN_RESULT",
7: "NETWORK_EVENT_TYPE_ACCEPT_ATTEMPT",
8: "NETWORK_EVENT_TYPE_ACCEPT_RESULT",
9: "NETWORK_EVENT_TYPE_SENDTO_ATTEMPT",
10: "NETWORK_EVENT_TYPE_SENDTO_RESULT",
11: "NETWORK_EVENT_TYPE_RECVFROM_ATTEMPT",
12: "NETWORK_EVENT_TYPE_RECVFROM_RESULT",
}
var NetworkEventType_value = map[string]int32{
"NETWORK_EVENT_TYPE_UNKNOWN": 0,
"NETWORK_EVENT_TYPE_CONNECT_ATTEMPT": 1,
"NETWORK_EVENT_TYPE_CONNECT_RESULT": 2,
"NETWORK_EVENT_TYPE_BIND_ATTEMPT": 3,
"NETWORK_EVENT_TYPE_BIND_RESULT": 4,
"NETWORK_EVENT_TYPE_LISTEN_ATTEMPT": 5,
"NETWORK_EVENT_TYPE_LISTEN_RESULT": 6,
"NETWORK_EVENT_TYPE_ACCEPT_ATTEMPT": 7,
"NETWORK_EVENT_TYPE_ACCEPT_RESULT": 8,
"NETWORK_EVENT_TYPE_SENDTO_ATTEMPT": 9,
"NETWORK_EVENT_TYPE_SENDTO_RESULT": 10,
"NETWORK_EVENT_TYPE_RECVFROM_ATTEMPT": 11,
"NETWORK_EVENT_TYPE_RECVFROM_RESULT": 12,
}
func (x NetworkEventType) String() string {
return proto.EnumName(NetworkEventType_name, int32(x))
}
func (NetworkEventType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{5} }
// Possible field types
type KernelFunctionCallEvent_FieldType int32
const (
// The field type is unknown
KernelFunctionCallEvent_UNKNOWN KernelFunctionCallEvent_FieldType = 0
// The field type is an array of bytes
KernelFunctionCallEvent_BYTES KernelFunctionCallEvent_FieldType = 1
// The field type is a string
KernelFunctionCallEvent_STRING KernelFunctionCallEvent_FieldType = 2
// The field type is a signed 8-bit integer
KernelFunctionCallEvent_SINT8 KernelFunctionCallEvent_FieldType = 3
// The field type is a signed 16-bit integer
KernelFunctionCallEvent_SINT16 KernelFunctionCallEvent_FieldType = 4
// The field type is a signed 32-bit integer
KernelFunctionCallEvent_SINT32 KernelFunctionCallEvent_FieldType = 5
// The field type is a signed 64-bit integer
KernelFunctionCallEvent_SINT64 KernelFunctionCallEvent_FieldType = 6
// The field type is an unsigned 8-bit integer
KernelFunctionCallEvent_UINT8 KernelFunctionCallEvent_FieldType = 7
// The field type is an unsigned 16-bit integer
KernelFunctionCallEvent_UINT16 KernelFunctionCallEvent_FieldType = 8
// The field type is an unsigned 32-bit integer
KernelFunctionCallEvent_UINT32 KernelFunctionCallEvent_FieldType = 9
// The field type is an unsigned 64-bit integer
KernelFunctionCallEvent_UINT64 KernelFunctionCallEvent_FieldType = 10
)
var KernelFunctionCallEvent_FieldType_name = map[int32]string{
0: "UNKNOWN",
1: "BYTES",
2: "STRING",
3: "SINT8",
4: "SINT16",
5: "SINT32",
6: "SINT64",
7: "UINT8",
8: "UINT16",
9: "UINT32",
10: "UINT64",
}
var KernelFunctionCallEvent_FieldType_value = map[string]int32{
"UNKNOWN": 0,
"BYTES": 1,
"STRING": 2,
"SINT8": 3,
"SINT16": 4,
"SINT32": 5,
"SINT64": 6,
"UINT8": 7,
"UINT16": 8,
"UINT32": 9,
"UINT64": 10,
}
func (x KernelFunctionCallEvent_FieldType) String() string {
return proto.EnumName(KernelFunctionCallEvent_FieldType_name, int32(x))
}
func (KernelFunctionCallEvent_FieldType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor1, []int{8, 0}
}
// An event observed by the Sensor.
type Event struct {
// Unique identifier for the event
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
// Unique process identifier associated with the event to differentiate
// reused values of the pid below.
ProcessId string `protobuf:"bytes,2,opt,name=process_id,json=processId" json:"process_id,omitempty"`
// Unix pid of the process associated with the event
ProcessPid int32 `protobuf:"varint,3,opt,name=process_pid,json=processPid" json:"process_pid,omitempty"`
// Container identifier associated with the event
ContainerId string `protobuf:"bytes,4,opt,name=container_id,json=containerId" json:"container_id,omitempty"`
// Sensor identifier of the sensor instance that observed the event
SensorId string `protobuf:"bytes,5,opt,name=sensor_id,json=sensorId" json:"sensor_id,omitempty"`
// Sequence number from some unspecified starting point unique
// to the Sensor. Provides a strict linear ordering of events with
// the same sensor_id where no two events can have the same sequence
// number. If it is present, it must be greater than zero. A zero
// value indicates that there is no sequence number associated with
// the event.
SensorSequenceNumber uint64 `protobuf:"varint,6,opt,name=sensor_sequence_number,json=sensorSequenceNumber" json:"sensor_sequence_number,omitempty"`
// Monotonic nanosecond timestamp from some unspecified starting
// point unique to the Sensor. Can only be used to calculate time
// intervals between events with the same sensor_id.
SensorMonotimeNanos int64 `protobuf:"varint,7,opt,name=sensor_monotime_nanos,json=sensorMonotimeNanos" json:"sensor_monotime_nanos,omitempty"`
// Process Lineage contains one process context for each process in the
// hierarchy, starting with the current process, up to the root of the
// process namespace.
ProcessLineage []*Process `protobuf:"bytes,8,rep,name=process_lineage,json=processLineage" json:"process_lineage,omitempty"`
// Name of container associated with the event
ContainerName string `protobuf:"bytes,30,opt,name=container_name,json=containerName" json:"container_name,omitempty"`
// Unique identifier of the container image
ImageId string `protobuf:"bytes,31,opt,name=image_id,json=imageId" json:"image_id,omitempty"`
//
// Name of the container image (i.e. "busybox" or
// "gcr.io/google_containers/nginx-ingress-controller")
//
ImageName string `protobuf:"bytes,32,opt,name=image_name,json=imageName" json:"image_name,omitempty"`
// Types that are valid to be assigned to Event:
// *Event_Syscall
// *Event_Process
// *Event_File
// *Event_KernelCall
// *Event_Network
// *Event_Container
// *Event_Chargen
// *Event_Ticker
Event isEvent_Event `protobuf_oneof:"event"`
// CPU on which the event occurred
Cpu int32 `protobuf:"varint,201,opt,name=cpu" json:"cpu,omitempty"`
}
func (m *Event) Reset() { *m = Event{} }
func (m *Event) String() string { return proto.CompactTextString(m) }
func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
type isEvent_Event interface {
isEvent_Event()
}
type Event_Syscall struct {
Syscall *SyscallEvent `protobuf:"bytes,10,opt,name=syscall,oneof"`
}
type Event_Process struct {
Process *ProcessEvent `protobuf:"bytes,11,opt,name=process,oneof"`
}
type Event_File struct {
File *FileEvent `protobuf:"bytes,12,opt,name=file,oneof"`
}
type Event_KernelCall struct {
KernelCall *KernelFunctionCallEvent `protobuf:"bytes,13,opt,name=kernel_call,json=kernelCall,oneof"`
}
type Event_Network struct {
Network *NetworkEvent `protobuf:"bytes,14,opt,name=network,oneof"`
}
type Event_Container struct {
Container *ContainerEvent `protobuf:"bytes,20,opt,name=container,oneof"`
}
type Event_Chargen struct {
Chargen *ChargenEvent `protobuf:"bytes,100,opt,name=chargen,oneof"`
}
type Event_Ticker struct {
Ticker *TickerEvent `protobuf:"bytes,101,opt,name=ticker,oneof"`
}
func (*Event_Syscall) isEvent_Event() {}
func (*Event_Process) isEvent_Event() {}
func (*Event_File) isEvent_Event() {}
func (*Event_KernelCall) isEvent_Event() {}
func (*Event_Network) isEvent_Event() {}
func (*Event_Container) isEvent_Event() {}
func (*Event_Chargen) isEvent_Event() {}
func (*Event_Ticker) isEvent_Event() {}
func (m *Event) GetEvent() isEvent_Event {
if m != nil {
return m.Event
}
return nil
}
func (m *Event) GetId() string {
if m != nil {
return m.Id
}
return ""
}
func (m *Event) GetProcessId() string {
if m != nil {
return m.ProcessId
}
return ""
}
func (m *Event) GetProcessPid() int32 {
if m != nil {
return m.ProcessPid
}
return 0
}
func (m *Event) GetContainerId() string {
if m != nil {
return m.ContainerId
}
return ""
}
func (m *Event) GetSensorId() string {
if m != nil {
return m.SensorId
}
return ""
}
func (m *Event) GetSensorSequenceNumber() uint64 {
if m != nil {
return m.SensorSequenceNumber
}
return 0
}
func (m *Event) GetSensorMonotimeNanos() int64 {
if m != nil {
return m.SensorMonotimeNanos
}
return 0
}
func (m *Event) GetProcessLineage() []*Process {
if m != nil {
return m.ProcessLineage
}
return nil
}
func (m *Event) GetContainerName() string {
if m != nil {
return m.ContainerName
}
return ""
}
func (m *Event) GetImageId() string {
if m != nil {
return m.ImageId
}
return ""
}
func (m *Event) GetImageName() string {
if m != nil {
return m.ImageName
}
return ""
}
func (m *Event) GetSyscall() *SyscallEvent {
if x, ok := m.GetEvent().(*Event_Syscall); ok {
return x.Syscall
}
return nil
}
func (m *Event) GetProcess() *ProcessEvent {
if x, ok := m.GetEvent().(*Event_Process); ok {
return x.Process
}
return nil
}
func (m *Event) GetFile() *FileEvent {
if x, ok := m.GetEvent().(*Event_File); ok {
return x.File
}
return nil
}
func (m *Event) GetKernelCall() *KernelFunctionCallEvent {
if x, ok := m.GetEvent().(*Event_KernelCall); ok {
return x.KernelCall
}
return nil
}
func (m *Event) GetNetwork() *NetworkEvent {
if x, ok := m.GetEvent().(*Event_Network); ok {
return x.Network
}
return nil
}
func (m *Event) GetContainer() *ContainerEvent {
if x, ok := m.GetEvent().(*Event_Container); ok {
return x.Container
}
return nil
}
func (m *Event) GetChargen() *ChargenEvent {
if x, ok := m.GetEvent().(*Event_Chargen); ok {
return x.Chargen
}
return nil
}
func (m *Event) GetTicker() *TickerEvent {
if x, ok := m.GetEvent().(*Event_Ticker); ok {
return x.Ticker
}
return nil
}
func (m *Event) GetCpu() int32 {
if m != nil {
return m.Cpu
}
return 0
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*Event) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _Event_OneofMarshaler, _Event_OneofUnmarshaler, _Event_OneofSizer, []interface{}{
(*Event_Syscall)(nil),
(*Event_Process)(nil),
(*Event_File)(nil),
(*Event_KernelCall)(nil),
(*Event_Network)(nil),
(*Event_Container)(nil),
(*Event_Chargen)(nil),
(*Event_Ticker)(nil),
}
}
func _Event_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*Event)
// event
switch x := m.Event.(type) {
case *Event_Syscall:
b.EncodeVarint(10<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Syscall); err != nil {
return err
}
case *Event_Process:
b.EncodeVarint(11<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Process); err != nil {
return err
}
case *Event_File:
b.EncodeVarint(12<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.File); err != nil {
return err
}
case *Event_KernelCall:
b.EncodeVarint(13<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.KernelCall); err != nil {
return err
}
case *Event_Network:
b.EncodeVarint(14<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Network); err != nil {
return err
}
case *Event_Container:
b.EncodeVarint(20<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Container); err != nil {
return err
}
case *Event_Chargen:
b.EncodeVarint(100<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Chargen); err != nil {
return err
}
case *Event_Ticker:
b.EncodeVarint(101<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Ticker); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("Event.Event has unexpected type %T", x)
}
return nil
}
func _Event_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*Event)
switch tag {
case 10: // event.syscall
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(SyscallEvent)
err := b.DecodeMessage(msg)
m.Event = &Event_Syscall{msg}
return true, err
case 11: // event.process
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ProcessEvent)
err := b.DecodeMessage(msg)
m.Event = &Event_Process{msg}
return true, err
case 12: // event.file
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(FileEvent)
err := b.DecodeMessage(msg)
m.Event = &Event_File{msg}
return true, err
case 13: // event.kernel_call
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(KernelFunctionCallEvent)
err := b.DecodeMessage(msg)
m.Event = &Event_KernelCall{msg}
return true, err
case 14: // event.network
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(NetworkEvent)
err := b.DecodeMessage(msg)
m.Event = &Event_Network{msg}
return true, err
case 20: // event.container
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ContainerEvent)
err := b.DecodeMessage(msg)
m.Event = &Event_Container{msg}
return true, err
case 100: // event.chargen
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(ChargenEvent)
err := b.DecodeMessage(msg)
m.Event = &Event_Chargen{msg}
return true, err
case 101: // event.ticker
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TickerEvent)
err := b.DecodeMessage(msg)
m.Event = &Event_Ticker{msg}
return true, err
default:
return false, nil
}
}
func _Event_OneofSizer(msg proto.Message) (n int) {
m := msg.(*Event)
// event
switch x := m.Event.(type) {
case *Event_Syscall:
s := proto.Size(x.Syscall)
n += proto.SizeVarint(10<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Event_Process:
s := proto.Size(x.Process)
n += proto.SizeVarint(11<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Event_File:
s := proto.Size(x.File)
n += proto.SizeVarint(12<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Event_KernelCall:
s := proto.Size(x.KernelCall)
n += proto.SizeVarint(13<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Event_Network:
s := proto.Size(x.Network)
n += proto.SizeVarint(14<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Event_Container:
s := proto.Size(x.Container)
n += proto.SizeVarint(20<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Event_Chargen:
s := proto.Size(x.Chargen)
n += proto.SizeVarint(100<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case *Event_Ticker:
s := proto.Size(x.Ticker)
n += proto.SizeVarint(101<<3 | proto.WireBytes)
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type ChargenEvent struct {
// Index of the first character in this Event in relation to all of
// the characters that have been generated in this stream.
Index uint64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
// The next one or more characters in the autogenerated stream
Characters string `protobuf:"bytes,2,opt,name=characters" json:"characters,omitempty"`
}
func (m *ChargenEvent) Reset() { *m = ChargenEvent{} }
func (m *ChargenEvent) String() string { return proto.CompactTextString(m) }
func (*ChargenEvent) ProtoMessage() {}
func (*ChargenEvent) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
func (m *ChargenEvent) GetIndex() uint64 {
if m != nil {
return m.Index
}
return 0
}
func (m *ChargenEvent) GetCharacters() string {
if m != nil {
return m.Characters
}
return ""
}
type TickerEvent struct {
// The number of seconds elapsed since January 1, 1970 UTC.
//
// https://golang.org/pkg/time/#Time.Unix
Seconds int64 `protobuf:"varint,1,opt,name=seconds" json:"seconds,omitempty"`
// The number of nanoseconds elapsed since January 1, 1970 UTC
//
// https://golang.org/pkg/time/#Time.UnixNano
Nanoseconds int64 `protobuf:"varint,2,opt,name=nanoseconds" json:"nanoseconds,omitempty"`
}
func (m *TickerEvent) Reset() { *m = TickerEvent{} }
func (m *TickerEvent) String() string { return proto.CompactTextString(m) }
func (*TickerEvent) ProtoMessage() {}
func (*TickerEvent) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
func (m *TickerEvent) GetSeconds() int64 {
if m != nil {
return m.Seconds
}
return 0
}
func (m *TickerEvent) GetNanoseconds() int64 {
if m != nil {
return m.Nanoseconds
}
return 0
}
// ContainerEvent describes a Docker container or Rkt App lifecycle event
type ContainerEvent struct {
Type ContainerEventType `protobuf:"varint,1,opt,name=type,enum=capsule8.api.v0.ContainerEventType" json:"type,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
// Unique identifier of the container image
ImageId string `protobuf:"bytes,10,opt,name=image_id,json=imageId" json:"image_id,omitempty"`
//
// Name of the container image (i.e. "busybox" or
// "gcr.io/google_containers/nginx-ingress-controller")
//
ImageName string `protobuf:"bytes,11,opt,name=image_name,json=imageName" json:"image_name,omitempty"`
// Host process identifier of the container's init process.
HostPid int32 `protobuf:"zigzag32,20,opt,name=host_pid,json=hostPid" json:"host_pid,omitempty"`
// Optional, only included on CONTAINER_EVENT_TYPE_EXIT events
ExitCode int32 `protobuf:"zigzag32,30,opt,name=exit_code,json=exitCode" json:"exit_code,omitempty"`
// The exit status will typically one of the values defined in
// stdlib.h like EXIT_SUCCESS, EXIT_FAILURE, or EXIT_USAGE.
ExitStatus uint32 `protobuf:"varint,31,opt,name=exit_status,json=exitStatus" json:"exit_status,omitempty"`
// If non-zero, this is the signal number that the process
// was terminated with.
ExitSignal uint32 `protobuf:"varint,32,opt,name=exit_signal,json=exitSignal" json:"exit_signal,omitempty"`
// If true, indicates that the process dumped a core when
// it terminated.
ExitCoreDumped bool `protobuf:"varint,33,opt,name=exit_core_dumped,json=exitCoreDumped" json:"exit_core_dumped,omitempty"`
// Docker container configuration file
DockerConfigJson string `protobuf:"bytes,100,opt,name=docker_config_json,json=dockerConfigJson" json:"docker_config_json,omitempty"`
// OCI container configuration file
OciConfigJson string `protobuf:"bytes,101,opt,name=oci_config_json,json=ociConfigJson" json:"oci_config_json,omitempty"`
}
func (m *ContainerEvent) Reset() { *m = ContainerEvent{} }
func (m *ContainerEvent) String() string { return proto.CompactTextString(m) }
func (*ContainerEvent) ProtoMessage() {}
func (*ContainerEvent) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
func (m *ContainerEvent) GetType() ContainerEventType {
if m != nil {
return m.Type
}
return ContainerEventType_CONTAINER_EVENT_TYPE_UNKNOWN
}
func (m *ContainerEvent) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ContainerEvent) GetImageId() string {
if m != nil {
return m.ImageId
}
return ""
}
func (m *ContainerEvent) GetImageName() string {
if m != nil {
return m.ImageName
}
return ""
}
func (m *ContainerEvent) GetHostPid() int32 {
if m != nil {
return m.HostPid
}
return 0
}
func (m *ContainerEvent) GetExitCode() int32 {
if m != nil {
return m.ExitCode
}
return 0
}
func (m *ContainerEvent) GetExitStatus() uint32 {
if m != nil {
return m.ExitStatus
}
return 0
}
func (m *ContainerEvent) GetExitSignal() uint32 {
if m != nil {
return m.ExitSignal
}
return 0
}
func (m *ContainerEvent) GetExitCoreDumped() bool {
if m != nil {
return m.ExitCoreDumped
}
return false
}
func (m *ContainerEvent) GetDockerConfigJson() string {
if m != nil {
return m.DockerConfigJson
}
return ""
}
func (m *ContainerEvent) GetOciConfigJson() string {
if m != nil {
return m.OciConfigJson
}
return ""
}
// ProcessEvent describes an event that occurred related to processes starting
// and exiting as detected by the Sensor.
type ProcessEvent struct {
// The type of event described by this ProcessEvent message
Type ProcessEventType `protobuf:"varint,1,opt,name=type,enum=capsule8.api.v0.ProcessEventType" json:"type,omitempty"`
// Present when the event is a fork event. This is the PID of the
// new child process.
ForkChildPid int32 `protobuf:"zigzag32,10,opt,name=fork_child_pid,json=forkChildPid" json:"fork_child_pid,omitempty"`
// Present when the event is a fork event. This is the Sensor's process
// ID of the new child process.
ForkChildId string `protobuf:"bytes,11,opt,name=fork_child_id,json=forkChildId" json:"fork_child_id,omitempty"`
// Present when the event is an exec event. This is the filename of the
// executable that was executed.
ExecFilename string `protobuf:"bytes,20,opt,name=exec_filename,json=execFilename" json:"exec_filename,omitempty"`
// Present when the event is an exec event. Repeated for each argument
// passed to the executable on the command-line.
ExecCommandLine []string `protobuf:"bytes,21,rep,name=exec_command_line,json=execCommandLine" json:"exec_command_line,omitempty"`
// Present when the event is an exit event. This is the exit code that
// the process exited with.
ExitCode int32 `protobuf:"zigzag32,30,opt,name=exit_code,json=exitCode" json:"exit_code,omitempty"`
// Present when the event is an exit event. This will typically be one9
// of the values defined in stdlib.h like EXIT_SUCCESS, EXIT_FAILURE,
// or EXIT_USAGE.
ExitStatus uint32 `protobuf:"varint,31,opt,name=exit_status,json=exitStatus" json:"exit_status,omitempty"`
// Present when the event is an exit event. If non-zero, this is the
// signal number that the process was terminated with.
ExitSignal uint32 `protobuf:"varint,32,opt,name=exit_signal,json=exitSignal" json:"exit_signal,omitempty"`
// Present when the event is an exit event. If true, indicates that the
// process dumped a core when it terminated.
ExitCoreDumped bool `protobuf:"varint,33,opt,name=exit_core_dumped,json=exitCoreDumped" json:"exit_core_dumped,omitempty"`
}
func (m *ProcessEvent) Reset() { *m = ProcessEvent{} }
func (m *ProcessEvent) String() string { return proto.CompactTextString(m) }
func (*ProcessEvent) ProtoMessage() {}
func (*ProcessEvent) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} }
func (m *ProcessEvent) GetType() ProcessEventType {
if m != nil {
return m.Type
}
return ProcessEventType_PROCESS_EVENT_TYPE_UNKNOWN
}
func (m *ProcessEvent) GetForkChildPid() int32 {
if m != nil {
return m.ForkChildPid
}
return 0
}
func (m *ProcessEvent) GetForkChildId() string {
if m != nil {
return m.ForkChildId
}
return ""
}
func (m *ProcessEvent) GetExecFilename() string {
if m != nil {
return m.ExecFilename
}
return ""
}
func (m *ProcessEvent) GetExecCommandLine() []string {
if m != nil {
return m.ExecCommandLine
}
return nil
}
func (m *ProcessEvent) GetExitCode() int32 {
if m != nil {
return m.ExitCode
}
return 0
}
func (m *ProcessEvent) GetExitStatus() uint32 {
if m != nil {
return m.ExitStatus
}
return 0
}
func (m *ProcessEvent) GetExitSignal() uint32 {
if m != nil {
return m.ExitSignal
}
return 0
}
func (m *ProcessEvent) GetExitCoreDumped() bool {
if m != nil {
return m.ExitCoreDumped
}
return false
}
// SyscallEvent describes an event that occurred related to system calls being
// made or returning as detected by the Sensor.
type SyscallEvent struct {
// The type of event described by this SyscallEvent message
Type SyscallEventType `protobuf:"varint,1,opt,name=type,enum=capsule8.api.v0.SyscallEventType" json:"type,omitempty"`
// The syscall number for either enter or exit events.
Id int64 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"`
// Present when the event is an enter event. This is the first
// argument passed to the system call.
Arg0 uint64 `protobuf:"varint,10,opt,name=arg0" json:"arg0,omitempty"`
// Present when the event is an enter event. This is the second
// argument passed to the system call.
Arg1 uint64 `protobuf:"varint,11,opt,name=arg1" json:"arg1,omitempty"`