diff --git a/types/api/v1beta1/tracee.pb.go b/types/api/v1beta1/tracee.pb.go index d2dd51d28adf..4c0b5c896729 100644 --- a/types/api/v1beta1/tracee.pb.go +++ b/types/api/v1beta1/tracee.pb.go @@ -105,26 +105,139 @@ func (x *GetVersionResponse) GetVersion() string { return "" } +type GetEventDefinitionRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // TODO: tags +} + +func (x *GetEventDefinitionRequest) Reset() { + *x = GetEventDefinitionRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetEventDefinitionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetEventDefinitionRequest) ProtoMessage() {} + +func (x *GetEventDefinitionRequest) ProtoReflect() protoreflect.Message { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetEventDefinitionRequest.ProtoReflect.Descriptor instead. +func (*GetEventDefinitionRequest) Descriptor() ([]byte, []int) { + return file_types_api_v1beta1_tracee_proto_rawDescGZIP(), []int{2} +} + +func (x *GetEventDefinitionRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetEventDefinitionResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Definitions []*EventDefinition `protobuf:"bytes,1,rep,name=definitions,proto3" json:"definitions,omitempty"` +} + +func (x *GetEventDefinitionResponse) Reset() { + *x = GetEventDefinitionResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetEventDefinitionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetEventDefinitionResponse) ProtoMessage() {} + +func (x *GetEventDefinitionResponse) ProtoReflect() protoreflect.Message { + mi := &file_types_api_v1beta1_tracee_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetEventDefinitionResponse.ProtoReflect.Descriptor instead. +func (*GetEventDefinitionResponse) Descriptor() ([]byte, []int) { + return file_types_api_v1beta1_tracee_proto_rawDescGZIP(), []int{3} +} + +func (x *GetEventDefinitionResponse) GetDefinitions() []*EventDefinition { + if x != nil { + return x.Definitions + } + return nil +} + var File_types_api_v1beta1_tracee_proto protoreflect.FileDescriptor var file_types_api_v1beta1_tracee_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x32, 0x64, 0x0a, 0x0d, 0x54, 0x72, 0x61, 0x63, 0x65, 0x65, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, - 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x2f, 0x61, 0x71, 0x75, 0x61, 0x73, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x1a, 0x22, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x12, 0x47, 0x65, 0x74, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x19, 0x47, 0x65, 0x74, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5f, 0x0a, 0x1a, 0x47, 0x65, + 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0b, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, + 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0xd1, 0x01, 0x0a, 0x0d, + 0x54, 0x72, 0x61, 0x63, 0x65, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, + 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, + 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x2f, 0x61, 0x71, 0x75, + 0x61, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -139,19 +252,25 @@ func file_types_api_v1beta1_tracee_proto_rawDescGZIP() []byte { return file_types_api_v1beta1_tracee_proto_rawDescData } -var file_types_api_v1beta1_tracee_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_types_api_v1beta1_tracee_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_types_api_v1beta1_tracee_proto_goTypes = []interface{}{ - (*GetVersionRequest)(nil), // 0: tracee.v1beta1.GetVersionRequest - (*GetVersionResponse)(nil), // 1: tracee.v1beta1.GetVersionResponse + (*GetVersionRequest)(nil), // 0: tracee.v1beta1.GetVersionRequest + (*GetVersionResponse)(nil), // 1: tracee.v1beta1.GetVersionResponse + (*GetEventDefinitionRequest)(nil), // 2: tracee.v1beta1.GetEventDefinitionRequest + (*GetEventDefinitionResponse)(nil), // 3: tracee.v1beta1.GetEventDefinitionResponse + (*EventDefinition)(nil), // 4: tracee.v1beta1.EventDefinition } var file_types_api_v1beta1_tracee_proto_depIdxs = []int32{ - 0, // 0: tracee.v1beta1.TraceeService.GetVersion:input_type -> tracee.v1beta1.GetVersionRequest - 1, // 1: tracee.v1beta1.TraceeService.GetVersion:output_type -> tracee.v1beta1.GetVersionResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 4, // 0: tracee.v1beta1.GetEventDefinitionResponse.definitions:type_name -> tracee.v1beta1.EventDefinition + 2, // 1: tracee.v1beta1.TraceeService.GetEventDefinition:input_type -> tracee.v1beta1.GetEventDefinitionRequest + 0, // 2: tracee.v1beta1.TraceeService.GetVersion:input_type -> tracee.v1beta1.GetVersionRequest + 3, // 3: tracee.v1beta1.TraceeService.GetEventDefinition:output_type -> tracee.v1beta1.GetEventDefinitionResponse + 1, // 4: tracee.v1beta1.TraceeService.GetVersion:output_type -> tracee.v1beta1.GetVersionResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_types_api_v1beta1_tracee_proto_init() } @@ -159,6 +278,7 @@ func file_types_api_v1beta1_tracee_proto_init() { if File_types_api_v1beta1_tracee_proto != nil { return } + file_types_api_v1beta1_definition_proto_init() if !protoimpl.UnsafeEnabled { file_types_api_v1beta1_tracee_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetVersionRequest); i { @@ -184,6 +304,30 @@ func file_types_api_v1beta1_tracee_proto_init() { return nil } } + file_types_api_v1beta1_tracee_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetEventDefinitionRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_types_api_v1beta1_tracee_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetEventDefinitionResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -191,7 +335,7 @@ func file_types_api_v1beta1_tracee_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_types_api_v1beta1_tracee_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/types/api/v1beta1/tracee.proto b/types/api/v1beta1/tracee.proto index bf56ca7f9e41..33e482be70f2 100644 --- a/types/api/v1beta1/tracee.proto +++ b/types/api/v1beta1/tracee.proto @@ -4,6 +4,8 @@ option go_package = "github.co/aquasecurity/tracee/api/v1beta1"; package tracee.v1beta1; +import "types/api/v1beta1/definition.proto"; + message GetVersionRequest { } @@ -11,6 +13,17 @@ message GetVersionResponse { string version = 1; } +message GetEventDefinitionRequest { + string name = 1; + // TODO: tags +} + +message GetEventDefinitionResponse { + repeated EventDefinition definitions = 1; +} + service TraceeService { + rpc GetEventDefinition(GetEventDefinitionRequest) returns (GetEventDefinitionResponse); + rpc GetVersion(GetVersionRequest) returns (GetVersionResponse); -} \ No newline at end of file +} diff --git a/types/api/v1beta1/tracee_grpc.pb.go b/types/api/v1beta1/tracee_grpc.pb.go index 243c1165410d..34f6796feabd 100644 --- a/types/api/v1beta1/tracee_grpc.pb.go +++ b/types/api/v1beta1/tracee_grpc.pb.go @@ -22,6 +22,7 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type TraceeServiceClient interface { + GetEventDefinition(ctx context.Context, in *GetEventDefinitionRequest, opts ...grpc.CallOption) (*GetEventDefinitionResponse, error) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error) } @@ -33,6 +34,15 @@ func NewTraceeServiceClient(cc grpc.ClientConnInterface) TraceeServiceClient { return &traceeServiceClient{cc} } +func (c *traceeServiceClient) GetEventDefinition(ctx context.Context, in *GetEventDefinitionRequest, opts ...grpc.CallOption) (*GetEventDefinitionResponse, error) { + out := new(GetEventDefinitionResponse) + err := c.cc.Invoke(ctx, "/tracee.v1beta1.TraceeService/GetEventDefinition", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *traceeServiceClient) GetVersion(ctx context.Context, in *GetVersionRequest, opts ...grpc.CallOption) (*GetVersionResponse, error) { out := new(GetVersionResponse) err := c.cc.Invoke(ctx, "/tracee.v1beta1.TraceeService/GetVersion", in, out, opts...) @@ -46,6 +56,7 @@ func (c *traceeServiceClient) GetVersion(ctx context.Context, in *GetVersionRequ // All implementations must embed UnimplementedTraceeServiceServer // for forward compatibility type TraceeServiceServer interface { + GetEventDefinition(context.Context, *GetEventDefinitionRequest) (*GetEventDefinitionResponse, error) GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error) mustEmbedUnimplementedTraceeServiceServer() } @@ -54,6 +65,9 @@ type TraceeServiceServer interface { type UnimplementedTraceeServiceServer struct { } +func (UnimplementedTraceeServiceServer) GetEventDefinition(context.Context, *GetEventDefinitionRequest) (*GetEventDefinitionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEventDefinition not implemented") +} func (UnimplementedTraceeServiceServer) GetVersion(context.Context, *GetVersionRequest) (*GetVersionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") } @@ -70,6 +84,24 @@ func RegisterTraceeServiceServer(s grpc.ServiceRegistrar, srv TraceeServiceServe s.RegisterService(&TraceeService_ServiceDesc, srv) } +func _TraceeService_GetEventDefinition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetEventDefinitionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TraceeServiceServer).GetEventDefinition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tracee.v1beta1.TraceeService/GetEventDefinition", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TraceeServiceServer).GetEventDefinition(ctx, req.(*GetEventDefinitionRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _TraceeService_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetVersionRequest) if err := dec(in); err != nil { @@ -95,6 +127,10 @@ var TraceeService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "tracee.v1beta1.TraceeService", HandlerType: (*TraceeServiceServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "GetEventDefinition", + Handler: _TraceeService_GetEventDefinition_Handler, + }, { MethodName: "GetVersion", Handler: _TraceeService_GetVersion_Handler,