diff --git a/apps/provider-scaffold/template/provider/provider.go.template b/apps/provider-scaffold/template/provider/provider.go.template index c48ac74dd3..269eeac962 100644 --- a/apps/provider-scaffold/template/provider/provider.go.template +++ b/apps/provider-scaffold/template/provider/provider.go.template @@ -69,6 +69,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.{{ .CamelcaseProviderID }}Connection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/cli/providers/providers.go b/cli/providers/providers.go index 4124961b5e..08d1218edc 100644 --- a/cli/providers/providers.go +++ b/cli/providers/providers.go @@ -276,6 +276,7 @@ func setConnector(provider *plugin.Provider, connector *plugin.Connector, run fu } } + // TODO: add flag to set timeout and then use RuntimeWithShutdownTimeout runtime := providers.Coordinator.NewRuntime() // TODO: read from config diff --git a/explorer/cnquery_explorer.pb.go b/explorer/cnquery_explorer.pb.go index d2daa421b1..2780d2c248 100644 --- a/explorer/cnquery_explorer.pb.go +++ b/explorer/cnquery_explorer.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.2 // source: cnquery_explorer.proto package explorer diff --git a/explorer/scan/cnquery_explorer_scan.pb.go b/explorer/scan/cnquery_explorer_scan.pb.go index 49db3c5124..8e157caa69 100644 --- a/explorer/scan/cnquery_explorer_scan.pb.go +++ b/explorer/scan/cnquery_explorer_scan.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.2 // source: cnquery_explorer_scan.proto package scan diff --git a/llx/llx.pb.go b/llx/llx.pb.go index a8b1a4114a..e27f09ed4b 100644 --- a/llx/llx.pb.go +++ b/llx/llx.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.2 // source: llx.proto package llx diff --git a/providers-sdk/v1/plugin/grpc.go b/providers-sdk/v1/plugin/grpc.go index 1f60c13f9f..1b292cf85b 100644 --- a/providers-sdk/v1/plugin/grpc.go +++ b/providers-sdk/v1/plugin/grpc.go @@ -50,6 +50,10 @@ func (m *GRPCClient) Connect(req *ConnectReq, callback ProviderCallback) (*Conne return res, err } +func (m *GRPCClient) Shutdown(req *ShutdownReq) (*ShutdownRes, error) { + return m.client.Shutdown(context.Background(), req) +} + func (m *GRPCClient) GetData(req *DataReq) (*DataRes, error) { return m.client.GetData(context.Background(), req) } diff --git a/providers-sdk/v1/plugin/interface.go b/providers-sdk/v1/plugin/interface.go index 2236b8e099..5d99653215 100644 --- a/providers-sdk/v1/plugin/interface.go +++ b/providers-sdk/v1/plugin/interface.go @@ -32,6 +32,7 @@ type ProviderCallback interface { type ProviderPlugin interface { ParseCLI(req *ParseCLIReq) (*ParseCLIRes, error) Connect(req *ConnectReq, callback ProviderCallback) (*ConnectRes, error) + Shutdown(req *ShutdownReq) (*ShutdownRes, error) GetData(req *DataReq) (*DataRes, error) StoreData(req *StoreReq) (*StoreRes, error) } diff --git a/providers-sdk/v1/plugin/plugin.pb.go b/providers-sdk/v1/plugin/plugin.pb.go index a184900607..74d01579c4 100644 --- a/providers-sdk/v1/plugin/plugin.pb.go +++ b/providers-sdk/v1/plugin/plugin.pb.go @@ -290,6 +290,82 @@ func (x *ConnectRes) GetInventory() *inventory.Inventory { return nil } +type ShutdownReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ShutdownReq) Reset() { + *x = ShutdownReq{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShutdownReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShutdownReq) ProtoMessage() {} + +func (x *ShutdownReq) ProtoReflect() protoreflect.Message { + mi := &file_plugin_proto_msgTypes[4] + 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 ShutdownReq.ProtoReflect.Descriptor instead. +func (*ShutdownReq) Descriptor() ([]byte, []int) { + return file_plugin_proto_rawDescGZIP(), []int{4} +} + +type ShutdownRes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ShutdownRes) Reset() { + *x = ShutdownRes{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ShutdownRes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ShutdownRes) ProtoMessage() {} + +func (x *ShutdownRes) ProtoReflect() protoreflect.Message { + mi := &file_plugin_proto_msgTypes[5] + 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 ShutdownRes.ProtoReflect.Descriptor instead. +func (*ShutdownRes) Descriptor() ([]byte, []int) { + return file_plugin_proto_rawDescGZIP(), []int{5} +} + type DataReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -305,7 +381,7 @@ type DataReq struct { func (x *DataReq) Reset() { *x = DataReq{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_proto_msgTypes[4] + mi := &file_plugin_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -318,7 +394,7 @@ func (x *DataReq) String() string { func (*DataReq) ProtoMessage() {} func (x *DataReq) ProtoReflect() protoreflect.Message { - mi := &file_plugin_proto_msgTypes[4] + mi := &file_plugin_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -331,7 +407,7 @@ func (x *DataReq) ProtoReflect() protoreflect.Message { // Deprecated: Use DataReq.ProtoReflect.Descriptor instead. func (*DataReq) Descriptor() ([]byte, []int) { - return file_plugin_proto_rawDescGZIP(), []int{4} + return file_plugin_proto_rawDescGZIP(), []int{6} } func (x *DataReq) GetConnection() uint32 { @@ -383,7 +459,7 @@ type DataRes struct { func (x *DataRes) Reset() { *x = DataRes{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_proto_msgTypes[5] + mi := &file_plugin_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -396,7 +472,7 @@ func (x *DataRes) String() string { func (*DataRes) ProtoMessage() {} func (x *DataRes) ProtoReflect() protoreflect.Message { - mi := &file_plugin_proto_msgTypes[5] + mi := &file_plugin_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -409,7 +485,7 @@ func (x *DataRes) ProtoReflect() protoreflect.Message { // Deprecated: Use DataRes.ProtoReflect.Descriptor instead. func (*DataRes) Descriptor() ([]byte, []int) { - return file_plugin_proto_rawDescGZIP(), []int{5} + return file_plugin_proto_rawDescGZIP(), []int{7} } func (x *DataRes) GetData() *llx.Primitive { @@ -442,7 +518,7 @@ type CollectRes struct { func (x *CollectRes) Reset() { *x = CollectRes{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_proto_msgTypes[6] + mi := &file_plugin_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -455,7 +531,7 @@ func (x *CollectRes) String() string { func (*CollectRes) ProtoMessage() {} func (x *CollectRes) ProtoReflect() protoreflect.Message { - mi := &file_plugin_proto_msgTypes[6] + mi := &file_plugin_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -468,7 +544,7 @@ func (x *CollectRes) ProtoReflect() protoreflect.Message { // Deprecated: Use CollectRes.ProtoReflect.Descriptor instead. func (*CollectRes) Descriptor() ([]byte, []int) { - return file_plugin_proto_rawDescGZIP(), []int{6} + return file_plugin_proto_rawDescGZIP(), []int{8} } type StoreReq struct { @@ -483,7 +559,7 @@ type StoreReq struct { func (x *StoreReq) Reset() { *x = StoreReq{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_proto_msgTypes[7] + mi := &file_plugin_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -496,7 +572,7 @@ func (x *StoreReq) String() string { func (*StoreReq) ProtoMessage() {} func (x *StoreReq) ProtoReflect() protoreflect.Message { - mi := &file_plugin_proto_msgTypes[7] + mi := &file_plugin_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -509,7 +585,7 @@ func (x *StoreReq) ProtoReflect() protoreflect.Message { // Deprecated: Use StoreReq.ProtoReflect.Descriptor instead. func (*StoreReq) Descriptor() ([]byte, []int) { - return file_plugin_proto_rawDescGZIP(), []int{7} + return file_plugin_proto_rawDescGZIP(), []int{9} } func (x *StoreReq) GetConnection() uint32 { @@ -539,7 +615,7 @@ type ResourceData struct { func (x *ResourceData) Reset() { *x = ResourceData{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_proto_msgTypes[8] + mi := &file_plugin_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -552,7 +628,7 @@ func (x *ResourceData) String() string { func (*ResourceData) ProtoMessage() {} func (x *ResourceData) ProtoReflect() protoreflect.Message { - mi := &file_plugin_proto_msgTypes[8] + mi := &file_plugin_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -565,7 +641,7 @@ func (x *ResourceData) ProtoReflect() protoreflect.Message { // Deprecated: Use ResourceData.ProtoReflect.Descriptor instead. func (*ResourceData) Descriptor() ([]byte, []int) { - return file_plugin_proto_rawDescGZIP(), []int{8} + return file_plugin_proto_rawDescGZIP(), []int{10} } func (x *ResourceData) GetName() string { @@ -598,7 +674,7 @@ type StoreRes struct { func (x *StoreRes) Reset() { *x = StoreRes{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_proto_msgTypes[9] + mi := &file_plugin_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -611,7 +687,7 @@ func (x *StoreRes) String() string { func (*StoreRes) ProtoMessage() {} func (x *StoreRes) ProtoReflect() protoreflect.Message { - mi := &file_plugin_proto_msgTypes[9] + mi := &file_plugin_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -624,7 +700,7 @@ func (x *StoreRes) ProtoReflect() protoreflect.Message { // Deprecated: Use StoreRes.ProtoReflect.Descriptor instead. func (*StoreRes) Descriptor() ([]byte, []int) { - return file_plugin_proto_rawDescGZIP(), []int{9} + return file_plugin_proto_rawDescGZIP(), []int{11} } var File_plugin_proto protoreflect.FileDescriptor @@ -681,62 +757,69 @@ var file_plugin_proto_rawDesc = []byte{ 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, - 0x79, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x8a, 0x02, 0x0a, - 0x07, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x3b, 0x0a, 0x04, 0x61, - 0x72, 0x67, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6e, 0x71, 0x75, + 0x79, 0x52, 0x09, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x0d, 0x0a, 0x0b, + 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x0d, 0x0a, 0x0b, 0x53, + 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x22, 0x8a, 0x02, 0x0a, 0x07, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x3b, 0x0a, 0x04, 0x61, 0x72, 0x67, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x2e, 0x41, 0x72, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x1a, 0x4f, 0x0a, 0x09, 0x41, 0x72, 0x67, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x6c, + 0x6c, 0x78, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x5b, 0x0a, 0x07, 0x44, 0x61, 0x74, 0x61, 0x52, + 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x6c, 0x6c, 0x78, 0x2e, 0x50, + 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x22, 0x6c, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1e, + 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, + 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x22, 0xca, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x4e, 0x0a, + 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x29, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x6c, 0x6c, 0x78, 0x2e, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x0a, 0x0a, + 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x32, 0x99, 0x03, 0x0a, 0x0e, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x50, 0x0a, 0x08, + 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x4c, 0x49, 0x12, 0x21, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x4c, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x63, 0x6e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x4c, 0x49, 0x52, 0x65, 0x73, 0x12, 0x4d, + 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x20, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x2e, 0x41, 0x72, 0x67, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x1a, 0x4f, 0x0a, 0x09, 0x41, 0x72, 0x67, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x6c, 0x6c, 0x78, 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x5b, 0x0a, 0x07, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x6c, 0x6c, 0x78, - 0x2e, 0x50, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x22, 0x6c, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, - 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x40, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x22, 0xca, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x46, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, - 0x4e, 0x0a, 0x0b, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x6c, 0x6c, 0x78, 0x2e, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x0a, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x32, 0xc7, 0x02, 0x0a, 0x0e, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x50, - 0x0a, 0x08, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x4c, 0x49, 0x12, 0x21, 0x2e, 0x63, 0x6e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x4c, 0x49, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, - 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x4c, 0x49, 0x52, 0x65, 0x73, - 0x12, 0x4d, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x12, 0x20, 0x2e, 0x63, 0x6e, + 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x20, 0x2e, - 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x12, 0x50, 0x0a, + 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x21, 0x2e, 0x63, 0x6e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x21, 0x2e, 0x63, + 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x63, 0x6e, 0x71, 0x75, @@ -780,57 +863,61 @@ func file_plugin_proto_rawDescGZIP() []byte { return file_plugin_proto_rawDescData } -var file_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_plugin_proto_goTypes = []interface{}{ (*ParseCLIReq)(nil), // 0: cnquery.providers.v1.ParseCLIReq (*ParseCLIRes)(nil), // 1: cnquery.providers.v1.ParseCLIRes (*ConnectReq)(nil), // 2: cnquery.providers.v1.ConnectReq (*ConnectRes)(nil), // 3: cnquery.providers.v1.ConnectRes - (*DataReq)(nil), // 4: cnquery.providers.v1.DataReq - (*DataRes)(nil), // 5: cnquery.providers.v1.DataRes - (*CollectRes)(nil), // 6: cnquery.providers.v1.CollectRes - (*StoreReq)(nil), // 7: cnquery.providers.v1.StoreReq - (*ResourceData)(nil), // 8: cnquery.providers.v1.ResourceData - (*StoreRes)(nil), // 9: cnquery.providers.v1.StoreRes - nil, // 10: cnquery.providers.v1.ParseCLIReq.FlagsEntry - nil, // 11: cnquery.providers.v1.DataReq.ArgsEntry - nil, // 12: cnquery.providers.v1.ResourceData.FieldsEntry - (*inventory.Asset)(nil), // 13: cnquery.providers.v1.Asset - (*upstream.UpstreamConfig)(nil), // 14: mondoo.cnquery.upstream.v1.UpstreamConfig - (*inventory.Inventory)(nil), // 15: cnquery.providers.v1.Inventory - (*llx.Primitive)(nil), // 16: cnquery.llx.Primitive - (*llx.Result)(nil), // 17: cnquery.llx.Result + (*ShutdownReq)(nil), // 4: cnquery.providers.v1.ShutdownReq + (*ShutdownRes)(nil), // 5: cnquery.providers.v1.ShutdownRes + (*DataReq)(nil), // 6: cnquery.providers.v1.DataReq + (*DataRes)(nil), // 7: cnquery.providers.v1.DataRes + (*CollectRes)(nil), // 8: cnquery.providers.v1.CollectRes + (*StoreReq)(nil), // 9: cnquery.providers.v1.StoreReq + (*ResourceData)(nil), // 10: cnquery.providers.v1.ResourceData + (*StoreRes)(nil), // 11: cnquery.providers.v1.StoreRes + nil, // 12: cnquery.providers.v1.ParseCLIReq.FlagsEntry + nil, // 13: cnquery.providers.v1.DataReq.ArgsEntry + nil, // 14: cnquery.providers.v1.ResourceData.FieldsEntry + (*inventory.Asset)(nil), // 15: cnquery.providers.v1.Asset + (*upstream.UpstreamConfig)(nil), // 16: mondoo.cnquery.upstream.v1.UpstreamConfig + (*inventory.Inventory)(nil), // 17: cnquery.providers.v1.Inventory + (*llx.Primitive)(nil), // 18: cnquery.llx.Primitive + (*llx.Result)(nil), // 19: cnquery.llx.Result } var file_plugin_proto_depIdxs = []int32{ - 10, // 0: cnquery.providers.v1.ParseCLIReq.flags:type_name -> cnquery.providers.v1.ParseCLIReq.FlagsEntry - 13, // 1: cnquery.providers.v1.ParseCLIRes.asset:type_name -> cnquery.providers.v1.Asset - 13, // 2: cnquery.providers.v1.ConnectReq.asset:type_name -> cnquery.providers.v1.Asset - 14, // 3: cnquery.providers.v1.ConnectReq.upstream:type_name -> mondoo.cnquery.upstream.v1.UpstreamConfig - 13, // 4: cnquery.providers.v1.ConnectRes.asset:type_name -> cnquery.providers.v1.Asset - 15, // 5: cnquery.providers.v1.ConnectRes.inventory:type_name -> cnquery.providers.v1.Inventory - 11, // 6: cnquery.providers.v1.DataReq.args:type_name -> cnquery.providers.v1.DataReq.ArgsEntry - 16, // 7: cnquery.providers.v1.DataRes.data:type_name -> cnquery.llx.Primitive - 8, // 8: cnquery.providers.v1.StoreReq.resources:type_name -> cnquery.providers.v1.ResourceData - 12, // 9: cnquery.providers.v1.ResourceData.fields:type_name -> cnquery.providers.v1.ResourceData.FieldsEntry - 16, // 10: cnquery.providers.v1.ParseCLIReq.FlagsEntry.value:type_name -> cnquery.llx.Primitive - 16, // 11: cnquery.providers.v1.DataReq.ArgsEntry.value:type_name -> cnquery.llx.Primitive - 17, // 12: cnquery.providers.v1.ResourceData.FieldsEntry.value:type_name -> cnquery.llx.Result + 12, // 0: cnquery.providers.v1.ParseCLIReq.flags:type_name -> cnquery.providers.v1.ParseCLIReq.FlagsEntry + 15, // 1: cnquery.providers.v1.ParseCLIRes.asset:type_name -> cnquery.providers.v1.Asset + 15, // 2: cnquery.providers.v1.ConnectReq.asset:type_name -> cnquery.providers.v1.Asset + 16, // 3: cnquery.providers.v1.ConnectReq.upstream:type_name -> mondoo.cnquery.upstream.v1.UpstreamConfig + 15, // 4: cnquery.providers.v1.ConnectRes.asset:type_name -> cnquery.providers.v1.Asset + 17, // 5: cnquery.providers.v1.ConnectRes.inventory:type_name -> cnquery.providers.v1.Inventory + 13, // 6: cnquery.providers.v1.DataReq.args:type_name -> cnquery.providers.v1.DataReq.ArgsEntry + 18, // 7: cnquery.providers.v1.DataRes.data:type_name -> cnquery.llx.Primitive + 10, // 8: cnquery.providers.v1.StoreReq.resources:type_name -> cnquery.providers.v1.ResourceData + 14, // 9: cnquery.providers.v1.ResourceData.fields:type_name -> cnquery.providers.v1.ResourceData.FieldsEntry + 18, // 10: cnquery.providers.v1.ParseCLIReq.FlagsEntry.value:type_name -> cnquery.llx.Primitive + 18, // 11: cnquery.providers.v1.DataReq.ArgsEntry.value:type_name -> cnquery.llx.Primitive + 19, // 12: cnquery.providers.v1.ResourceData.FieldsEntry.value:type_name -> cnquery.llx.Result 0, // 13: cnquery.providers.v1.ProviderPlugin.ParseCLI:input_type -> cnquery.providers.v1.ParseCLIReq 2, // 14: cnquery.providers.v1.ProviderPlugin.Connect:input_type -> cnquery.providers.v1.ConnectReq - 4, // 15: cnquery.providers.v1.ProviderPlugin.GetData:input_type -> cnquery.providers.v1.DataReq - 7, // 16: cnquery.providers.v1.ProviderPlugin.StoreData:input_type -> cnquery.providers.v1.StoreReq - 5, // 17: cnquery.providers.v1.ProviderCallback.Collect:input_type -> cnquery.providers.v1.DataRes - 4, // 18: cnquery.providers.v1.ProviderCallback.GetRecording:input_type -> cnquery.providers.v1.DataReq - 4, // 19: cnquery.providers.v1.ProviderCallback.GetData:input_type -> cnquery.providers.v1.DataReq - 1, // 20: cnquery.providers.v1.ProviderPlugin.ParseCLI:output_type -> cnquery.providers.v1.ParseCLIRes - 3, // 21: cnquery.providers.v1.ProviderPlugin.Connect:output_type -> cnquery.providers.v1.ConnectRes - 5, // 22: cnquery.providers.v1.ProviderPlugin.GetData:output_type -> cnquery.providers.v1.DataRes - 9, // 23: cnquery.providers.v1.ProviderPlugin.StoreData:output_type -> cnquery.providers.v1.StoreRes - 6, // 24: cnquery.providers.v1.ProviderCallback.Collect:output_type -> cnquery.providers.v1.CollectRes - 8, // 25: cnquery.providers.v1.ProviderCallback.GetRecording:output_type -> cnquery.providers.v1.ResourceData - 5, // 26: cnquery.providers.v1.ProviderCallback.GetData:output_type -> cnquery.providers.v1.DataRes - 20, // [20:27] is the sub-list for method output_type - 13, // [13:20] is the sub-list for method input_type + 4, // 15: cnquery.providers.v1.ProviderPlugin.Shutdown:input_type -> cnquery.providers.v1.ShutdownReq + 6, // 16: cnquery.providers.v1.ProviderPlugin.GetData:input_type -> cnquery.providers.v1.DataReq + 9, // 17: cnquery.providers.v1.ProviderPlugin.StoreData:input_type -> cnquery.providers.v1.StoreReq + 7, // 18: cnquery.providers.v1.ProviderCallback.Collect:input_type -> cnquery.providers.v1.DataRes + 6, // 19: cnquery.providers.v1.ProviderCallback.GetRecording:input_type -> cnquery.providers.v1.DataReq + 6, // 20: cnquery.providers.v1.ProviderCallback.GetData:input_type -> cnquery.providers.v1.DataReq + 1, // 21: cnquery.providers.v1.ProviderPlugin.ParseCLI:output_type -> cnquery.providers.v1.ParseCLIRes + 3, // 22: cnquery.providers.v1.ProviderPlugin.Connect:output_type -> cnquery.providers.v1.ConnectRes + 5, // 23: cnquery.providers.v1.ProviderPlugin.Shutdown:output_type -> cnquery.providers.v1.ShutdownRes + 7, // 24: cnquery.providers.v1.ProviderPlugin.GetData:output_type -> cnquery.providers.v1.DataRes + 11, // 25: cnquery.providers.v1.ProviderPlugin.StoreData:output_type -> cnquery.providers.v1.StoreRes + 8, // 26: cnquery.providers.v1.ProviderCallback.Collect:output_type -> cnquery.providers.v1.CollectRes + 10, // 27: cnquery.providers.v1.ProviderCallback.GetRecording:output_type -> cnquery.providers.v1.ResourceData + 7, // 28: cnquery.providers.v1.ProviderCallback.GetData:output_type -> cnquery.providers.v1.DataRes + 21, // [21:29] is the sub-list for method output_type + 13, // [13:21] is the sub-list for method input_type 13, // [13:13] is the sub-list for extension type_name 13, // [13:13] is the sub-list for extension extendee 0, // [0:13] is the sub-list for field type_name @@ -891,7 +978,7 @@ func file_plugin_proto_init() { } } file_plugin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataReq); i { + switch v := v.(*ShutdownReq); i { case 0: return &v.state case 1: @@ -903,7 +990,7 @@ func file_plugin_proto_init() { } } file_plugin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DataRes); i { + switch v := v.(*ShutdownRes); i { case 0: return &v.state case 1: @@ -915,7 +1002,7 @@ func file_plugin_proto_init() { } } file_plugin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CollectRes); i { + switch v := v.(*DataReq); i { case 0: return &v.state case 1: @@ -927,7 +1014,7 @@ func file_plugin_proto_init() { } } file_plugin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StoreReq); i { + switch v := v.(*DataRes); i { case 0: return &v.state case 1: @@ -939,7 +1026,7 @@ func file_plugin_proto_init() { } } file_plugin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResourceData); i { + switch v := v.(*CollectRes); i { case 0: return &v.state case 1: @@ -951,6 +1038,30 @@ func file_plugin_proto_init() { } } file_plugin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoreReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResourceData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StoreRes); i { case 0: return &v.state @@ -969,7 +1080,7 @@ func file_plugin_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plugin_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 15, NumExtensions: 0, NumServices: 2, }, diff --git a/providers-sdk/v1/plugin/plugin.proto b/providers-sdk/v1/plugin/plugin.proto index 79a205f3f8..67d932e044 100644 --- a/providers-sdk/v1/plugin/plugin.proto +++ b/providers-sdk/v1/plugin/plugin.proto @@ -38,6 +38,12 @@ message ConnectRes { Inventory inventory = 4; } +message ShutdownReq { +} + +message ShutdownRes { +} + message DataReq { uint32 connection = 1; string resource = 3; @@ -71,6 +77,7 @@ message StoreRes {} service ProviderPlugin { rpc ParseCLI(ParseCLIReq) returns (ParseCLIRes); rpc Connect(ConnectReq) returns (ConnectRes); + rpc Shutdown(ShutdownReq) returns (ShutdownRes); rpc GetData(DataReq) returns (DataRes); rpc StoreData(StoreReq) returns (StoreRes); } diff --git a/providers-sdk/v1/plugin/plugin_grpc.pb.go b/providers-sdk/v1/plugin/plugin_grpc.pb.go index 436c76f523..c98b7b162a 100644 --- a/providers-sdk/v1/plugin/plugin_grpc.pb.go +++ b/providers-sdk/v1/plugin/plugin_grpc.pb.go @@ -24,6 +24,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( ProviderPlugin_ParseCLI_FullMethodName = "/cnquery.providers.v1.ProviderPlugin/ParseCLI" ProviderPlugin_Connect_FullMethodName = "/cnquery.providers.v1.ProviderPlugin/Connect" + ProviderPlugin_Shutdown_FullMethodName = "/cnquery.providers.v1.ProviderPlugin/Shutdown" ProviderPlugin_GetData_FullMethodName = "/cnquery.providers.v1.ProviderPlugin/GetData" ProviderPlugin_StoreData_FullMethodName = "/cnquery.providers.v1.ProviderPlugin/StoreData" ) @@ -34,6 +35,7 @@ const ( type ProviderPluginClient interface { ParseCLI(ctx context.Context, in *ParseCLIReq, opts ...grpc.CallOption) (*ParseCLIRes, error) Connect(ctx context.Context, in *ConnectReq, opts ...grpc.CallOption) (*ConnectRes, error) + Shutdown(ctx context.Context, in *ShutdownReq, opts ...grpc.CallOption) (*ShutdownRes, error) GetData(ctx context.Context, in *DataReq, opts ...grpc.CallOption) (*DataRes, error) StoreData(ctx context.Context, in *StoreReq, opts ...grpc.CallOption) (*StoreRes, error) } @@ -64,6 +66,15 @@ func (c *providerPluginClient) Connect(ctx context.Context, in *ConnectReq, opts return out, nil } +func (c *providerPluginClient) Shutdown(ctx context.Context, in *ShutdownReq, opts ...grpc.CallOption) (*ShutdownRes, error) { + out := new(ShutdownRes) + err := c.cc.Invoke(ctx, ProviderPlugin_Shutdown_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *providerPluginClient) GetData(ctx context.Context, in *DataReq, opts ...grpc.CallOption) (*DataRes, error) { out := new(DataRes) err := c.cc.Invoke(ctx, ProviderPlugin_GetData_FullMethodName, in, out, opts...) @@ -88,6 +99,7 @@ func (c *providerPluginClient) StoreData(ctx context.Context, in *StoreReq, opts type ProviderPluginServer interface { ParseCLI(context.Context, *ParseCLIReq) (*ParseCLIRes, error) Connect(context.Context, *ConnectReq) (*ConnectRes, error) + Shutdown(context.Context, *ShutdownReq) (*ShutdownRes, error) GetData(context.Context, *DataReq) (*DataRes, error) StoreData(context.Context, *StoreReq) (*StoreRes, error) mustEmbedUnimplementedProviderPluginServer() @@ -103,6 +115,9 @@ func (UnimplementedProviderPluginServer) ParseCLI(context.Context, *ParseCLIReq) func (UnimplementedProviderPluginServer) Connect(context.Context, *ConnectReq) (*ConnectRes, error) { return nil, status.Errorf(codes.Unimplemented, "method Connect not implemented") } +func (UnimplementedProviderPluginServer) Shutdown(context.Context, *ShutdownReq) (*ShutdownRes, error) { + return nil, status.Errorf(codes.Unimplemented, "method Shutdown not implemented") +} func (UnimplementedProviderPluginServer) GetData(context.Context, *DataReq) (*DataRes, error) { return nil, status.Errorf(codes.Unimplemented, "method GetData not implemented") } @@ -158,6 +173,24 @@ func _ProviderPlugin_Connect_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _ProviderPlugin_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ShutdownReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ProviderPluginServer).Shutdown(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ProviderPlugin_Shutdown_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ProviderPluginServer).Shutdown(ctx, req.(*ShutdownReq)) + } + return interceptor(ctx, in, info, handler) +} + func _ProviderPlugin_GetData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DataReq) if err := dec(in); err != nil { @@ -209,6 +242,10 @@ var ProviderPlugin_ServiceDesc = grpc.ServiceDesc{ MethodName: "Connect", Handler: _ProviderPlugin_Connect_Handler, }, + { + MethodName: "Shutdown", + Handler: _ProviderPlugin_Shutdown_Handler, + }, { MethodName: "GetData", Handler: _ProviderPlugin_GetData_Handler, diff --git a/providers-sdk/v1/upstream/health/health.pb.go b/providers-sdk/v1/upstream/health/health.pb.go index 040d875d0c..136e0e87a4 100644 --- a/providers-sdk/v1/upstream/health/health.pb.go +++ b/providers-sdk/v1/upstream/health/health.pb.go @@ -18,7 +18,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.2 // source: health.proto package health diff --git a/providers-sdk/v1/upstream/mvd/cvss/cvss.pb.go b/providers-sdk/v1/upstream/mvd/cvss/cvss.pb.go index e4a5846e13..663b67335f 100644 --- a/providers-sdk/v1/upstream/mvd/cvss/cvss.pb.go +++ b/providers-sdk/v1/upstream/mvd/cvss/cvss.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.2 // source: cvss.proto package cvss diff --git a/providers-sdk/v1/upstream/mvd/mvd.pb.go b/providers-sdk/v1/upstream/mvd/mvd.pb.go index c5ecb0a0f0..4f0d80d0bd 100644 --- a/providers-sdk/v1/upstream/mvd/mvd.pb.go +++ b/providers-sdk/v1/upstream/mvd/mvd.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.2 // source: mvd.proto package mvd diff --git a/providers-sdk/v1/upstream/upstream.pb.go b/providers-sdk/v1/upstream/upstream.pb.go index 5019f19ec7..8faa4b8d4a 100644 --- a/providers-sdk/v1/upstream/upstream.pb.go +++ b/providers-sdk/v1/upstream/upstream.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.2 // source: upstream.proto package upstream diff --git a/providers/arista/provider/provider.go b/providers/arista/provider/provider.go index 109a0eb566..1118f41f23 100644 --- a/providers/arista/provider/provider.go +++ b/providers/arista/provider/provider.go @@ -109,6 +109,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.AristaConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/arista/resources/arista.lr.manifest.yaml b/providers/arista/resources/arista.lr.manifest.yaml index 00adfe120e..252855c5a0 100755 --- a/providers/arista/resources/arista.lr.manifest.yaml +++ b/providers/arista/resources/arista.lr.manifest.yaml @@ -49,6 +49,7 @@ resources: name: {} physicalAddress: {} status: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: @@ -58,6 +59,7 @@ resources: address: {} mtu: {} name: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: @@ -74,6 +76,7 @@ resources: default: {} name: {} rules: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: diff --git a/providers/aws/provider/provider.go b/providers/aws/provider/provider.go index a587f078db..ec0d4aa75c 100644 --- a/providers/aws/provider/provider.go +++ b/providers/aws/provider/provider.go @@ -153,6 +153,13 @@ func (s *Service) detect(asset *inventory.Asset, conn *connection.AwsConnection) return nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) GetData(req *plugin.DataReq) (*plugin.DataRes, error) { runtime, ok := s.runtimes[req.Connection] if !ok { diff --git a/providers/azure/provider/provider.go b/providers/azure/provider/provider.go index c9ef0d7d77..3e17a6f662 100644 --- a/providers/azure/provider/provider.go +++ b/providers/azure/provider/provider.go @@ -131,6 +131,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.AzureConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/azure/resources/azure.lr.manifest.yaml b/providers/azure/resources/azure.lr.manifest.yaml index 96eee900ee..257b4fd171 100644 --- a/providers/azure/resources/azure.lr.manifest.yaml +++ b/providers/azure/resources/azure.lr.manifest.yaml @@ -154,6 +154,7 @@ resources: name: {} osDisk: {} properties: {} + publicIpAddresses: {} tags: {} type: {} min_mondoo_version: latest diff --git a/providers/core/provider/provider.go b/providers/core/provider/provider.go index 7013706605..083269902e 100644 --- a/providers/core/provider/provider.go +++ b/providers/core/provider/provider.go @@ -69,6 +69,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) GetData(req *plugin.DataReq) (*plugin.DataRes, error) { runtime, ok := s.runtimes[req.Connection] if !ok { diff --git a/providers/core/resources/core.lr.manifest.yaml b/providers/core/resources/core.lr.manifest.yaml index 35f8168663..ceef32106c 100644 --- a/providers/core/resources/core.lr.manifest.yaml +++ b/providers/core/resources/core.lr.manifest.yaml @@ -4,18 +4,18 @@ resources: asset: fields: - name: {} - ids: {} - platform: {} - kind: {} - runtime: {} - version: {} arch: {} - title: {} + build: {} family: {} fqdn: {} - build: {} + ids: {} + kind: {} labels: {} + name: {} + platform: {} + runtime: {} + title: {} + version: {} vulnerabilityReport: {} min_mondoo_version: 6.13.0 audit.advisory: @@ -27,7 +27,6 @@ resources: published: {} title: {} worstScore: {} - is_private: true min_mondoo_version: 5.15.0 audit.cve: fields: @@ -39,13 +38,11 @@ resources: summary: {} unscored: {} worstScore: {} - is_private: true min_mondoo_version: 5.15.0 audit.cvss: fields: score: {} vector: {} - is_private: true min_mondoo_version: 5.15.0 audit.exploit: fields: @@ -53,7 +50,6 @@ resources: modified: {} mrn: {} worstScore: {} - is_private: true min_mondoo_version: 5.15.0 authorizedkeys: fields: @@ -146,6 +142,8 @@ resources: min_mondoo_version: 5.15.0 mondoo: fields: + arch: + min_mondoo_version: latest build: {} capabilities: {} jobEnvironment: {} diff --git a/providers/core/resources/core.resources.json b/providers/core/resources/core.resources.json index 9132c843e6..61b1d4e04a 100644 --- a/providers/core/resources/core.resources.json +++ b/providers/core/resources/core.resources.json @@ -1 +1 @@ -{"resources":{"asset":{"id":"asset","name":"asset","fields":{"arch":{"name":"arch","type":"\u0007","is_mandatory":true,"title":"Architecture this OS is running on","provider":"go.mondoo.com/cnquery/providers/core"},"build":{"name":"build","type":"\u0007","is_mandatory":true,"title":"Build version of the platform (optional)","provider":"go.mondoo.com/cnquery/providers/core"},"family":{"name":"family","type":"\u0019\u0007","is_mandatory":true,"title":"List of platform families that this platform belongs to","provider":"go.mondoo.com/cnquery/providers/core"},"fqdn":{"name":"fqdn","type":"\u0007","is_mandatory":true,"title":"Fully qualified domain name (optional)","provider":"go.mondoo.com/cnquery/providers/core"},"ids":{"name":"ids","type":"\u0019\u0007","is_mandatory":true,"title":"All identifiers for this asset","provider":"go.mondoo.com/cnquery/providers/core"},"kind":{"name":"kind","type":"\u0007","is_mandatory":true,"title":"Kind of platform, for example:","desc":"api, baremetal, vm, vm-image, container, container-image, network, ...","provider":"go.mondoo.com/cnquery/providers/core"},"labels":{"name":"labels","type":"\u001a\u0007\u0007","is_mandatory":true,"title":"Optional platform information","provider":"go.mondoo.com/cnquery/providers/core"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Human readable name of the asset","provider":"go.mondoo.com/cnquery/providers/core"},"platform":{"name":"platform","type":"\u0007","is_mandatory":true,"title":"Platform for this asset (redhat, windows, k8s-pod)","provider":"go.mondoo.com/cnquery/providers/core"},"runtime":{"name":"runtime","type":"\u0007","is_mandatory":true,"title":"Runtime is the specific kind of the platform. Examples include:","desc":"docker-container, podman-container, aws-ec2-instance, ...","provider":"go.mondoo.com/cnquery/providers/core"},"title":{"name":"title","type":"\u0007","is_mandatory":true,"title":"Human-readable title of the platform (e.g. \"Red Hat 8, Container\")","provider":"go.mondoo.com/cnquery/providers/core"},"version":{"name":"version","type":"\u0007","is_mandatory":true,"title":"Version of the platform","provider":"go.mondoo.com/cnquery/providers/core"}},"title":"General asset information","min_mondoo_version":"6.13.0","defaults":"name platform version","provider":"go.mondoo.com/cnquery/providers/core"},"mondoo":{"id":"mondoo","name":"mondoo","fields":{"arch":{"name":"arch","type":"\u0007","title":"The architecture of this client (e.g. linux-amd64)","min_mondoo_version":"latest","provider":"go.mondoo.com/cnquery/providers/core"},"build":{"name":"build","type":"\u0007","title":"The build of the client (e.g. production, development)","provider":"go.mondoo.com/cnquery/providers/core"},"capabilities":{"name":"capabilities","type":"\u0019\u0007","title":"Connection capabilities","provider":"go.mondoo.com/cnquery/providers/core"},"jobEnvironment":{"name":"jobEnvironment","type":"\n","title":"Returns the agent execution environment","provider":"go.mondoo.com/cnquery/providers/core"},"version":{"name":"version","type":"\u0007","title":"Version of the client running on the asset","provider":"go.mondoo.com/cnquery/providers/core"}},"title":"Provide contextual information about MQL runtime and environment","min_mondoo_version":"5.15.0","defaults":"version","provider":"go.mondoo.com/cnquery/providers/core"},"parse":{"id":"parse","name":"parse","title":"Parse provides common parsers (json, ini, certs, etc)","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/core"},"regex":{"id":"regex","name":"regex","fields":{"creditCard":{"name":"creditCard","type":"\u0008","title":"Matches credit card numbers","provider":"go.mondoo.com/cnquery/providers/core"},"email":{"name":"email","type":"\u0008","title":"Matches email addresses","provider":"go.mondoo.com/cnquery/providers/core"},"emoji":{"name":"emoji","type":"\u0008","title":"Matches emojis","provider":"go.mondoo.com/cnquery/providers/core"},"ipv4":{"name":"ipv4","type":"\u0008","title":"Matches IPv4 addresses","provider":"go.mondoo.com/cnquery/providers/core"},"ipv6":{"name":"ipv6","type":"\u0008","title":"Matches IPv6 addresses","provider":"go.mondoo.com/cnquery/providers/core"},"mac":{"name":"mac","type":"\u0008","title":"Matches MAC addresses","provider":"go.mondoo.com/cnquery/providers/core"},"semver":{"name":"semver","type":"\u0008","title":"Matches semantic version numbers","provider":"go.mondoo.com/cnquery/providers/core"},"url":{"name":"url","type":"\u0008","title":"Matches URL addresses (HTTP/HTTPS)","provider":"go.mondoo.com/cnquery/providers/core"},"uuid":{"name":"uuid","type":"\u0008","title":"Matches hyphen-deliminated UUIDs","provider":"go.mondoo.com/cnquery/providers/core"}},"title":"Builtin regular expression functions","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/core"},"time":{"id":"time","name":"time","fields":{"day":{"name":"day","type":"\t","title":"One day, used for durations","provider":"go.mondoo.com/cnquery/providers/core"},"hour":{"name":"hour","type":"\t","title":"One hour, used for durations","provider":"go.mondoo.com/cnquery/providers/core"},"minute":{"name":"minute","type":"\t","title":"One minute, used for durations","provider":"go.mondoo.com/cnquery/providers/core"},"now":{"name":"now","type":"\t","title":"The current time on the local system","provider":"go.mondoo.com/cnquery/providers/core"},"second":{"name":"second","type":"\t","title":"One second, used for durations","provider":"go.mondoo.com/cnquery/providers/core"},"today":{"name":"today","type":"\t","title":"The current day starting at midnight","provider":"go.mondoo.com/cnquery/providers/core"},"tomorrow":{"name":"tomorrow","type":"\t","title":"The next day starting at midnight","provider":"go.mondoo.com/cnquery/providers/core"}},"title":"Date and time functions","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/core"},"uuid":{"id":"uuid","name":"uuid","fields":{"urn":{"name":"urn","type":"\u0007","title":"URN returns the RFC 2141 URN form of uuid","provider":"go.mondoo.com/cnquery/providers/core"},"value":{"name":"value","type":"\u0007","is_mandatory":true,"title":"Canonical string representation xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","provider":"go.mondoo.com/cnquery/providers/core"},"variant":{"name":"variant","type":"\u0007","title":"Variant encoded in uuid","provider":"go.mondoo.com/cnquery/providers/core"},"version":{"name":"version","type":"\u0005","title":"Version of uuid","provider":"go.mondoo.com/cnquery/providers/core"}},"init":{"args":[{"name":"value","type":"\u0007"}]},"title":"UUIDs based on RFC 4122 and DCE 1.1","min_mondoo_version":"5.15.0","defaults":"value","provider":"go.mondoo.com/cnquery/providers/core"}}} \ No newline at end of file +{"resources":{"asset":{"id":"asset","name":"asset","fields":{"arch":{"name":"arch","type":"\u0007","is_mandatory":true,"title":"Architecture this OS is running on","provider":"go.mondoo.com/cnquery/providers/core"},"build":{"name":"build","type":"\u0007","is_mandatory":true,"title":"Build version of the platform (optional)","provider":"go.mondoo.com/cnquery/providers/core"},"family":{"name":"family","type":"\u0019\u0007","is_mandatory":true,"title":"List of platform families that this platform belongs to","provider":"go.mondoo.com/cnquery/providers/core"},"fqdn":{"name":"fqdn","type":"\u0007","is_mandatory":true,"title":"Fully qualified domain name (optional)","provider":"go.mondoo.com/cnquery/providers/core"},"ids":{"name":"ids","type":"\u0019\u0007","is_mandatory":true,"title":"All identifiers for this asset","provider":"go.mondoo.com/cnquery/providers/core"},"kind":{"name":"kind","type":"\u0007","is_mandatory":true,"title":"Kind of platform, for example:","desc":"api, baremetal, vm, vm-image, container, container-image, network, ...","provider":"go.mondoo.com/cnquery/providers/core"},"labels":{"name":"labels","type":"\u001a\u0007\u0007","is_mandatory":true,"title":"Optional platform information","provider":"go.mondoo.com/cnquery/providers/core"},"name":{"name":"name","type":"\u0007","is_mandatory":true,"title":"Human readable name of the asset","provider":"go.mondoo.com/cnquery/providers/core"},"platform":{"name":"platform","type":"\u0007","is_mandatory":true,"title":"Platform for this asset (redhat, windows, k8s-pod)","provider":"go.mondoo.com/cnquery/providers/core"},"runtime":{"name":"runtime","type":"\u0007","is_mandatory":true,"title":"Runtime is the specific kind of the platform. Examples include:","desc":"docker-container, podman-container, aws-ec2-instance, ...","provider":"go.mondoo.com/cnquery/providers/core"},"title":{"name":"title","type":"\u0007","is_mandatory":true,"title":"Human-readable title of the platform (e.g. \"Red Hat 8, Container\")","provider":"go.mondoo.com/cnquery/providers/core"},"version":{"name":"version","type":"\u0007","is_mandatory":true,"title":"Version of the platform","provider":"go.mondoo.com/cnquery/providers/core"}},"title":"General asset information","min_mondoo_version":"6.13.0","defaults":"name platform version","provider":"go.mondoo.com/cnquery/providers/core"},"mondoo":{"id":"mondoo","name":"mondoo","fields":{"arch":{"name":"arch","type":"\u0007","title":"The architecture of this client (e.g. linux-amd64)","provider":"go.mondoo.com/cnquery/providers/core"},"build":{"name":"build","type":"\u0007","title":"The build of the client (e.g. production, development)","provider":"go.mondoo.com/cnquery/providers/core"},"capabilities":{"name":"capabilities","type":"\u0019\u0007","title":"Connection capabilities","provider":"go.mondoo.com/cnquery/providers/core"},"jobEnvironment":{"name":"jobEnvironment","type":"\n","title":"Returns the agent execution environment","provider":"go.mondoo.com/cnquery/providers/core"},"version":{"name":"version","type":"\u0007","title":"Version of the client running on the asset","provider":"go.mondoo.com/cnquery/providers/core"}},"title":"Provide contextual information about MQL runtime and environment","min_mondoo_version":"5.15.0","defaults":"version","provider":"go.mondoo.com/cnquery/providers/core"},"parse":{"id":"parse","name":"parse","title":"Parse provides common parsers (json, ini, certs, etc)","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/core"},"regex":{"id":"regex","name":"regex","fields":{"creditCard":{"name":"creditCard","type":"\u0008","title":"Matches credit card numbers","provider":"go.mondoo.com/cnquery/providers/core"},"email":{"name":"email","type":"\u0008","title":"Matches email addresses","provider":"go.mondoo.com/cnquery/providers/core"},"emoji":{"name":"emoji","type":"\u0008","title":"Matches emojis","provider":"go.mondoo.com/cnquery/providers/core"},"ipv4":{"name":"ipv4","type":"\u0008","title":"Matches IPv4 addresses","provider":"go.mondoo.com/cnquery/providers/core"},"ipv6":{"name":"ipv6","type":"\u0008","title":"Matches IPv6 addresses","provider":"go.mondoo.com/cnquery/providers/core"},"mac":{"name":"mac","type":"\u0008","title":"Matches MAC addresses","provider":"go.mondoo.com/cnquery/providers/core"},"semver":{"name":"semver","type":"\u0008","title":"Matches semantic version numbers","provider":"go.mondoo.com/cnquery/providers/core"},"url":{"name":"url","type":"\u0008","title":"Matches URL addresses (HTTP/HTTPS)","provider":"go.mondoo.com/cnquery/providers/core"},"uuid":{"name":"uuid","type":"\u0008","title":"Matches hyphen-deliminated UUIDs","provider":"go.mondoo.com/cnquery/providers/core"}},"title":"Builtin regular expression functions","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/core"},"time":{"id":"time","name":"time","fields":{"day":{"name":"day","type":"\t","title":"One day, used for durations","provider":"go.mondoo.com/cnquery/providers/core"},"hour":{"name":"hour","type":"\t","title":"One hour, used for durations","provider":"go.mondoo.com/cnquery/providers/core"},"minute":{"name":"minute","type":"\t","title":"One minute, used for durations","provider":"go.mondoo.com/cnquery/providers/core"},"now":{"name":"now","type":"\t","title":"The current time on the local system","provider":"go.mondoo.com/cnquery/providers/core"},"second":{"name":"second","type":"\t","title":"One second, used for durations","provider":"go.mondoo.com/cnquery/providers/core"},"today":{"name":"today","type":"\t","title":"The current day starting at midnight","provider":"go.mondoo.com/cnquery/providers/core"},"tomorrow":{"name":"tomorrow","type":"\t","title":"The next day starting at midnight","provider":"go.mondoo.com/cnquery/providers/core"}},"title":"Date and time functions","min_mondoo_version":"5.15.0","provider":"go.mondoo.com/cnquery/providers/core"},"uuid":{"id":"uuid","name":"uuid","fields":{"urn":{"name":"urn","type":"\u0007","title":"URN returns the RFC 2141 URN form of uuid","provider":"go.mondoo.com/cnquery/providers/core"},"value":{"name":"value","type":"\u0007","is_mandatory":true,"title":"Canonical string representation xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","provider":"go.mondoo.com/cnquery/providers/core"},"variant":{"name":"variant","type":"\u0007","title":"Variant encoded in uuid","provider":"go.mondoo.com/cnquery/providers/core"},"version":{"name":"version","type":"\u0005","title":"Version of uuid","provider":"go.mondoo.com/cnquery/providers/core"}},"init":{"args":[{"name":"value","type":"\u0007"}]},"title":"UUIDs based on RFC 4122 and DCE 1.1","min_mondoo_version":"5.15.0","defaults":"value","provider":"go.mondoo.com/cnquery/providers/core"}}} \ No newline at end of file diff --git a/providers/equinix/provider/provider.go b/providers/equinix/provider/provider.go index 68db0ceaef..5d629d3f3a 100644 --- a/providers/equinix/provider/provider.go +++ b/providers/equinix/provider/provider.go @@ -101,6 +101,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.EquinixConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/gcp/provider/provider.go b/providers/gcp/provider/provider.go index b431f21cf2..9455497af7 100644 --- a/providers/gcp/provider/provider.go +++ b/providers/gcp/provider/provider.go @@ -162,6 +162,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.GcpConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/gcp/resources/gcp.lr.manifest.yaml b/providers/gcp/resources/gcp.lr.manifest.yaml index 1bf6cf1bcd..3c37195e5e 100755 --- a/providers/gcp/resources/gcp.lr.manifest.yaml +++ b/providers/gcp/resources/gcp.lr.manifest.yaml @@ -88,4 +88,1998 @@ resources: projectNumber: {} storageClass: {} updated: {} - min_mondoo_version: 5.15.0 \ No newline at end of file + min_mondoo_version: 5.15.0 + gcp.accessApprovalSettings: + fields: + activeKeyVersion: {} + ancestorHasActiveKeyVersion: {} + enrolledAncestor: {} + enrolledServices: {} + invalidKeyVersion: {} + notificationEmails: {} + resourcePath: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.essentialContact: + fields: + email: {} + languageTag: {} + notificationCategories: {} + resourcePath: {} + validated: {} + validationState: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.folder: + fields: + created: {} + folders: {} + id: {} + name: {} + parentId: {} + projects: {} + state: {} + updated: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.folders: + fields: + children: {} + list: {} + parentId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.organization: + fields: + accessApprovalSettings: {} + folders: {} + iamPolicy: {} + id: {} + lifecycleState: {} + name: {} + projects: {} + state: {} + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project: + fields: + accessApprovalSettings: {} + apiKeys: {} + bigquery: {} + cloudFunctions: {} + cloudRun: {} + commonInstanceMetadata: {} + compute: {} + createTime: {} + dataproc: {} + dns: {} + essentialContacts: {} + gke: {} + iam: {} + iamPolicy: {} + id: {} + kms: {} + labels: {} + lifecycleState: {} + logging: {} + monitoring: {} + name: {} + number: {} + parentId: {} + pubsub: {} + recommendations: {} + services: {} + sql: {} + state: {} + storage: {} + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.apiKey: + fields: + annotations: {} + created: {} + deleted: {} + id: {} + keyString: {} + name: {} + projectId: {} + resourcePath: {} + restrictions: {} + updated: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.apiKey.restrictions: + fields: + androidKeyRestrictions: {} + apiTargets: {} + browserKeyRestrictions: {} + iosKeyRestrictions: {} + parentResourcePath: {} + serverKeyRestrictions: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.bigqueryService: + fields: + datasets: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.bigqueryService.dataset: + fields: + access: {} + created: {} + description: {} + id: {} + kmsName: {} + labels: {} + location: {} + models: {} + modified: {} + name: {} + projectId: {} + routines: {} + tables: {} + tags: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.bigqueryService.dataset.accessEntry: + fields: + datasetId: {} + datasetRef: {} + entity: {} + entityType: {} + id: {} + role: {} + routineRef: {} + viewRef: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.bigqueryService.model: + fields: + created: {} + datasetId: {} + description: {} + expirationTime: {} + id: {} + kmsName: {} + labels: {} + location: {} + modified: {} + name: {} + projectId: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.bigqueryService.routine: + fields: + created: {} + datasetId: {} + description: {} + id: {} + language: {} + modified: {} + projectId: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.bigqueryService.table: + fields: + clusteringFields: {} + created: {} + datasetId: {} + description: {} + expirationTime: {} + externalDataConfig: {} + id: {} + kmsName: {} + labels: {} + location: {} + materializedView: {} + modified: {} + name: {} + numBytes: {} + numLongTermBytes: {} + numRows: {} + projectId: {} + rangePartitioning: {} + requirePartitionFilter: {} + schema: {} + snapshotTime: {} + timePartitioning: {} + type: {} + useLegacySQL: {} + viewQuery: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudFunction: + fields: + availableMemoryMb: {} + buildEnvVars: {} + buildId: {} + buildName: {} + buildWorkerPool: {} + description: {} + dockerRegistry: {} + dockerRepository: {} + egressSettings: {} + entryPoint: {} + envVars: {} + eventTrigger: {} + httpsTrigger: {} + ingressSettings: {} + kmsKeyName: {} + labels: {} + maxInstances: {} + minInstances: {} + name: {} + network: {} + projectId: {} + runtime: {} + secretEnvVars: {} + secretVolumes: {} + serviceAccountEmail: {} + sourceArchiveUrl: {} + sourceRepository: {} + sourceUploadUrl: {} + status: {} + timeout: {} + updated: {} + versionId: {} + vpcConnector: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService: + fields: + jobs: {} + operations: {} + projectId: {} + regions: {} + services: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.condition: + fields: + id: {} + lastTransitionTime: {} + message: {} + severity: {} + state: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.container: + fields: + args: {} + command: {} + env: {} + id: {} + image: {} + livenessProbe: {} + name: {} + ports: {} + resources: {} + startupProbe: {} + volumeMounts: {} + workingDir: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.container.probe: + fields: + failureThreshold: {} + httpGet: {} + id: {} + initialDelaySeconds: {} + periodSeconds: {} + tcpSocket: {} + timeoutSeconds: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.job: + fields: + annotations: {} + client: {} + clientVersion: {} + conditions: {} + created: {} + creator: {} + deleted: {} + executionCount: {} + expired: {} + generation: {} + id: {} + labels: {} + lastModifier: {} + launchStage: {} + name: {} + observedGeneration: {} + projectId: {} + reconciling: {} + region: {} + template: {} + terminalCondition: {} + updated: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.job.executionTemplate: + fields: + annotations: {} + id: {} + labels: {} + parallelism: {} + taskCount: {} + template: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.job.executionTemplate.taskTemplate: + fields: + containers: {} + encryptionKey: {} + executionEnvironment: {} + id: {} + maxRetries: {} + projectId: {} + serviceAccount: {} + serviceAccountEmail: {} + timeout: {} + volumes: {} + vpcAccess: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.operation: + fields: + done: {} + name: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.service: + fields: + annotations: {} + conditions: {} + created: {} + creator: {} + deleted: {} + description: {} + expired: {} + generation: {} + id: {} + ingress: {} + labels: {} + lastModifier: {} + latestCreatedRevision: {} + latestReadyRevision: {} + launchStage: {} + name: {} + observedGeneration: {} + projectId: {} + reconciling: {} + region: {} + template: {} + terminalCondition: {} + traffic: {} + trafficStatuses: {} + updated: {} + uri: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.cloudRunService.service.revisionTemplate: + fields: + annotations: {} + containers: {} + encryptionKey: {} + executionEnvironment: {} + id: {} + labels: {} + maxInstanceRequestConcurrency: {} + name: {} + projectId: {} + scaling: {} + serviceAccount: {} + serviceAccountEmail: {} + timeout: {} + volumes: {} + vpcAccess: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService: + fields: + addresses: {} + backendServices: {} + disks: {} + firewalls: {} + forwardingRules: {} + images: {} + instances: {} + machineTypes: {} + networks: {} + projectId: {} + regions: {} + routers: {} + snapshots: {} + subnetworks: {} + zones: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.address: + fields: + address: {} + addressType: {} + created: {} + description: {} + id: {} + ipVersion: {} + ipv6EndpointType: {} + name: {} + network: {} + networkTier: {} + networkUrl: {} + prefixLength: {} + purpose: {} + regionUrl: {} + resourceUrls: {} + status: {} + subnetwork: {} + subnetworkUrl: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.attachedDisk: + fields: + architecture: {} + autoDelete: {} + boot: {} + deviceName: {} + diskSizeGb: {} + forceAttach: {} + guestOsFeatures: {} + id: {} + index: {} + interface: {} + licenses: {} + mode: {} + projectId: {} + source: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.backendService: + fields: + affinityCookieTtlSec: {} + backends: {} + cdnPolicy: {} + circuitBreakers: {} + compressionMode: {} + connectionDraining: {} + connectionTrackingPolicy: {} + consistentHash: {} + created: {} + customRequestHeaders: {} + customResponseHeaders: {} + description: {} + edgeSecurityPolicy: {} + enableCDN: {} + failoverPolicy: {} + healthChecks: {} + iap: {} + id: {} + loadBalancingScheme: {} + localityLbPolicies: {} + localityLbPolicy: {} + logConfig: {} + maxStreamDuration: {} + name: {} + networkUrl: {} + portName: {} + protocol: {} + regionUrl: {} + securityPolicyUrl: {} + securitySettings: {} + serviceBindingUrls: {} + sessionAffinity: {} + timeoutSec: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.backendService.backend: + fields: + balancingMode: {} + capacityScaler: {} + description: {} + failover: {} + groupUrl: {} + id: {} + maxConnections: {} + maxConnectionsPerEndpoint: {} + maxConnectionsPerInstance: {} + maxRate: {} + maxRatePerEndpoint: {} + maxRatePerInstance: {} + maxUtilization: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.backendService.cdnPolicy: + fields: + bypassCacheOnRequestHeaders: {} + cacheKeyPolicy: {} + cacheMode: {} + clientTtl: {} + defaultTtl: {} + id: {} + maxTtl: {} + negativeCaching: {} + negativeCachingPolicy: {} + requestCoalescing: {} + serveWhileStale: {} + signedUrlCacheMaxAgeSec: {} + signedUrlKeyNames: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.disk: + fields: + architecture: {} + created: {} + description: {} + diskEncryptionKey: {} + guestOsFeatures: {} + id: {} + labels: {} + lastAttachTimestamp: {} + lastDetachTimestamp: {} + licenses: {} + locationHint: {} + name: {} + physicalBlockSizeBytes: {} + provisionedIops: {} + sizeGb: {} + status: {} + zone: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.firewall: + fields: + allowed: {} + created: {} + denied: {} + description: {} + destinationRanges: {} + direction: {} + disabled: {} + id: {} + name: {} + priority: {} + projectId: {} + sourceRanges: {} + sourceServiceAccounts: {} + sourceTags: {} + targetServiceAccounts: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.forwardingRule: + fields: + allPorts: {} + allowGlobalAccess: {} + backendService: {} + created: {} + description: {} + id: {} + ipAddress: {} + ipProtocol: {} + ipVersion: {} + isMirroringCollector: {} + labels: {} + loadBalancingScheme: {} + metadataFilters: {} + name: {} + network: {} + networkTier: {} + networkUrl: {} + noAutomateDnsZone: {} + portRange: {} + ports: {} + regionUrl: {} + serviceDirectoryRegistrations: {} + serviceLabel: {} + serviceName: {} + subnetwork: {} + subnetworkUrl: {} + targetUrl: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.image: + fields: + architecture: {} + archiveSizeBytes: {} + created: {} + description: {} + diskSizeGb: {} + family: {} + id: {} + labels: {} + licenses: {} + name: {} + projectId: {} + status: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.instance: + fields: + canIpForward: {} + confidentialInstanceConfig: {} + cpuPlatform: {} + created: {} + deletionProtection: {} + description: {} + disks: {} + enableDisplay: {} + enableIntegrityMonitoring: {} + enableSecureBoot: {} + enableVtpm: {} + fingerprint: {} + guestAccelerators: {} + hostname: {} + id: {} + keyRevocationActionType: {} + labels: {} + lastStartTimestamp: {} + lastStopTimestamp: {} + lastSuspendedTimestamp: {} + machineType: {} + metadata: {} + minCpuPlatform: {} + name: {} + networkInterfaces: {} + physicalHostResourceStatus: {} + privateIpv6GoogleAccess: {} + projectId: {} + reservationAffinity: {} + resourcePolicies: {} + scheduling: {} + serviceAccounts: {} + sourceMachineImage: {} + startRestricted: {} + status: {} + statusMessage: {} + tags: {} + totalEgressBandwidthTier: {} + zone: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.machineType: + fields: + created: {} + description: {} + guestCpus: {} + id: {} + isSharedCpu: {} + maximumPersistentDisks: {} + maximumPersistentDisksSizeGb: {} + memoryMb: {} + name: {} + projectId: {} + zone: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.network: + fields: + autoCreateSubnetworks: {} + created: {} + description: {} + enableUlaInternalIpv6: {} + gatewayIPv4: {} + id: {} + mode: {} + mtu: {} + name: {} + networkFirewallPolicyEnforcementOrder: {} + peerings: {} + projectId: {} + routingMode: {} + subnetworkUrls: {} + subnetworks: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.region: + fields: + created: {} + deprecated: {} + description: {} + id: {} + name: {} + quotas: {} + status: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.router: + fields: + bgp: {} + bgpPeers: {} + created: {} + description: {} + encryptedInterconnectRouter: {} + id: {} + name: {} + nats: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.serviceaccount: + fields: + email: {} + scopes: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.snapshot: + fields: + architecture: {} + autoCreated: {} + chainName: {} + created: {} + creationSizeBytes: {} + description: {} + diskSizeGb: {} + downloadBytes: {} + id: {} + labels: {} + licenses: {} + name: {} + snapshotType: {} + status: {} + storageBytes: {} + storageBytesStatus: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.subnetwork: + fields: + created: {} + description: {} + enableFlowLogs: {} + externalIpv6Prefix: {} + fingerprint: {} + gatewayAddress: {} + id: {} + internalIpv6Prefix: {} + ipCidrRange: {} + ipv6AccessType: {} + ipv6CidrRange: {} + logConfig: {} + name: {} + privateIpGoogleAccess: {} + privateIpv6GoogleAccess: {} + projectId: {} + purpose: {} + region: {} + regionUrl: {} + role: {} + stackType: {} + state: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.subnetwork.logConfig: + fields: + aggregationInterval: {} + enable: {} + filterExpression: {} + flowSampling: {} + id: {} + metadata: {} + metadataFields: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.computeService.zone: + fields: + created: {} + description: {} + id: {} + name: {} + status: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService: + fields: + clusters: {} + enabled: {} + projectId: {} + regions: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster: + fields: + config: {} + labels: {} + metrics: {} + name: {} + projectId: {} + status: {} + statusHistory: {} + uuid: {} + virtualClusterConfig: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.config: + fields: + autoscaling: {} + configBucket: {} + encryption: {} + endpoint: {} + gceCluster: {} + gkeCluster: {} + initializationActions: {} + lifecycle: {} + master: {} + metastore: {} + metrics: {} + parentResourcePath: {} + secondaryWorker: {} + security: {} + software: {} + tempBucket: {} + worker: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.config.gceCluster: + fields: + confidentialInstance: {} + id: {} + internalIpOnly: {} + metadata: {} + networkUri: {} + nodeGroupAffinity: {} + privateIpv6GoogleAccess: {} + projectId: {} + reservationAffinity: {} + serviceAccount: {} + serviceAccountEmail: {} + serviceAccountScopes: {} + shieldedInstanceConfig: {} + subnetworkUri: {} + tags: {} + zoneUri: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.config.gceCluster.reservationAffinity: + fields: + consumeReservationType: {} + id: {} + key: {} + values: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.config.gceCluster.shieldedInstanceConfig: + fields: + enableIntegrityMonitoring: {} + enableSecureBoot: {} + enableVtpm: {} + id: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.config.gkeCluster: + fields: + gkeClusterTarget: {} + id: {} + nodePoolTarget: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.config.instance: + fields: + accelerators: {} + diskConfig: {} + id: {} + imageUri: {} + instanceNames: {} + instanceReferences: {} + isPreemptible: {} + machineTypeUri: {} + managedGroupConfig: {} + minCpuPlatform: {} + numInstances: {} + preemptibility: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.config.instance.diskConfig: + fields: + bootDiskSizeGb: {} + bootDiskType: {} + id: {} + localSsdInterface: {} + numLocalSsds: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.config.lifecycle: + fields: + autoDeleteTime: {} + autoDeleteTtl: {} + id: {} + idleDeleteTtl: {} + idleStartTime: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.status: + fields: + detail: {} + id: {} + started: {} + state: {} + substate: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dataprocService.cluster.virtualClusterConfig: + fields: + auxiliaryServices: {} + kubernetesCluster: {} + parentResourcePath: {} + stagingBucket: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dnsService: + fields: + managedZones: {} + policies: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dnsService.managedzone: + fields: + created: {} + description: {} + dnsName: {} + dnssecConfig: {} + id: {} + name: {} + nameServerSet: {} + nameServers: {} + projectId: {} + recordSets: {} + visibility: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dnsService.policy: + fields: + description: {} + enableInboundForwarding: {} + enableLogging: {} + id: {} + name: {} + networkNames: {} + networks: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.dnsService.recordset: + fields: + name: {} + projectId: {} + rrdatas: {} + signatureRrdatas: {} + ttl: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService: + fields: + clusters: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster: + fields: + addonsConfig: {} + autopilotEnabled: {} + binaryAuthorization: {} + clusterIpv4Cidr: {} + created: {} + currentMasterVersion: {} + databaseEncryption: {} + description: {} + enableKubernetesAlpha: {} + endpoint: {} + expirationTime: {} + id: {} + initialClusterVersion: {} + ipAllocationPolicy: {} + legacyAbac: {} + location: {} + locations: {} + loggingService: {} + masterAuth: {} + masterAuthorizedNetworksConfig: {} + monitoringService: {} + name: {} + network: {} + networkConfig: {} + nodePools: {} + privateClusterConfig: {} + projectId: {} + resourceLabels: {} + status: {} + subnetwork: {} + workloadIdentityConfig: {} + zone: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.addonsConfig: + fields: + cloudRunConfig: {} + configConnectorConfig: {} + dnsCacheConfig: {} + gcePersistentDiskCsiDriverConfig: {} + gcpFilestoreCsiDriverConfig: {} + gkeBackupAgentConfig: {} + horizontalPodAutoscaling: {} + httpLoadBalancing: {} + id: {} + kubernetesDashboard: {} + networkPolicyConfig: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.ipAllocationPolicy: + fields: + clusterIpv4CidrBlock: {} + clusterSecondaryRangeName: {} + createSubnetwork: {} + id: {} + ipv6AccessType: {} + nodeIpv4CidrBlock: {} + servicesIpv4CidrBlock: {} + servicesSecondaryRangeName: {} + stackType: {} + subnetworkName: {} + tpuIpv4CidrBlock: {} + useIpAliases: {} + useRoutes: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.networkConfig: + fields: + datapathProvider: {} + defaultSnatStatus: {} + dnsConfig: {} + enableIntraNodeVisibility: {} + enableL4IlbSubsetting: {} + id: {} + network: {} + networkPath: {} + privateIpv6GoogleAccess: {} + serviceExternalIpsConfig: {} + subnetwork: {} + subnetworkPath: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool: + fields: + config: {} + id: {} + initialNodeCount: {} + instanceGroupUrls: {} + locations: {} + management: {} + name: {} + networkConfig: {} + status: {} + version: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config: + fields: + accelerators: {} + advancedMachineFeatures: {} + bootDiskKmsKey: {} + confidentialNodes: {} + diskSizeGb: {} + diskType: {} + gcfsConfig: {} + gvnicConfig: {} + id: {} + imageType: {} + kubeletConfig: {} + labels: {} + linuxNodeConfig: {} + localSsdCount: {} + machineType: {} + metadata: {} + minCpuPlatform: {} + oauthScopes: {} + preemptible: {} + projectId: {} + sandboxConfig: {} + serviceAccount: {} + serviceAccountEmail: {} + shieldedInstanceConfig: {} + spot: {} + tags: {} + taints: {} + workloadMetadataMode: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.accelerator: + fields: + count: {} + gpuPartitionSize: {} + gpuSharingConfig: {} + id: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.accelerator.gpuSharingConfig: + fields: + id: {} + maxSharedClientsPerGpu: {} + strategy: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.advancedMachineFeatures: + fields: + id: {} + threadsPerCore: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.confidentialNodes: + fields: + enabled: {} + id: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.gcfsConfig: + fields: + enabled: {} + id: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.gvnicConfig: + fields: + enabled: {} + id: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.kubeletConfig: + fields: + cpuCfsQuotaPeriod: {} + cpuManagerPolicy: {} + id: {} + podPidsLimit: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.linuxNodeConfig: + fields: + id: {} + sysctls: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.nodeTaint: + fields: + effect: {} + id: {} + key: {} + value: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.sandboxConfig: + fields: + id: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.config.shieldedInstanceConfig: + fields: + enableIntegrityMonitoring: {} + enableSecureBoot: {} + id: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.networkConfig: + fields: + id: {} + performanceConfig: {} + podIpv4CidrBlock: {} + podRange: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.gkeService.cluster.nodepool.networkConfig.performanceConfig: + fields: + id: {} + totalEgressBandwidthTier: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.iamService: + fields: + projectId: {} + serviceAccounts: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.iamService.serviceAccount: + fields: + description: {} + disabled: {} + displayName: {} + email: {} + keys: {} + name: {} + oauth2ClientId: {} + projectId: {} + uniqueId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.iamService.serviceAccount.key: + fields: + disabled: {} + keyAlgorithm: {} + keyOrigin: {} + keyType: {} + name: {} + validAfterTime: {} + validBeforeTime: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.kmsService: + fields: + keyrings: {} + locations: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.kmsService.keyring: + fields: + created: {} + cryptokeys: {} + location: {} + name: {} + projectId: {} + resourcePath: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.kmsService.keyring.cryptokey: + fields: + created: {} + cryptoKeyBackend: {} + destroyScheduledDuration: {} + iamPolicy: {} + importOnly: {} + labels: {} + name: {} + nextRotation: {} + primary: {} + purpose: {} + resourcePath: {} + rotationPeriod: {} + versionTemplate: {} + versions: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.kmsService.keyring.cryptokey.version: + fields: + algorithm: {} + attestation: {} + created: {} + destroyEventTime: {} + destroyed: {} + externalProtectionLevelOptions: {} + generated: {} + importFailureReason: {} + importJob: {} + importTime: {} + name: {} + protectionLevel: {} + reimportEligible: {} + resourcePath: {} + state: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.kmsService.keyring.cryptokey.version.attestation: + fields: + certificateChains: {} + cryptoKeyVersionName: {} + format: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.kmsService.keyring.cryptokey.version.attestation.certificatechains: + fields: + caviumCerts: {} + cryptoKeyVersionName: {} + googleCardCerts: {} + googlePartitionCerts: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.kmsService.keyring.cryptokey.version.externalProtectionLevelOptions: + fields: + cryptoKeyVersionName: {} + ekmConnectionKeyPath: {} + externalKeyUri: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.loggingservice: + fields: + buckets: {} + metrics: {} + projectId: {} + sinks: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.loggingservice.bucket: + fields: + cmekSettings: {} + created: {} + description: {} + indexConfigs: {} + lifecycleState: {} + locked: {} + name: {} + projectId: {} + restrictedFields: {} + retentionDays: {} + updated: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.loggingservice.bucket.indexConfig: + fields: + created: {} + fieldPath: {} + id: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.loggingservice.metric: + fields: + alertPolicies: {} + description: {} + filter: {} + id: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.loggingservice.sink: + fields: + destination: {} + filter: {} + id: {} + includeChildren: {} + projectId: {} + storageBucket: {} + writerIdentity: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.monitoringService: + fields: + alertPolicies: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.monitoringService.alertPolicy: + fields: + alertStrategy: {} + combiner: {} + conditions: {} + created: {} + createdBy: {} + displayName: {} + documentation: {} + enabled: {} + labels: {} + name: {} + notificationChannelUrls: {} + projectId: {} + updated: {} + updatedBy: {} + validity: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.pubsubService: + fields: + projectId: {} + snapshots: {} + subscriptions: {} + topics: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.pubsubService.snapshot: + fields: + expiration: {} + name: {} + projectId: {} + topic: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.pubsubService.subscription: + fields: + config: {} + name: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.pubsubService.subscription.config: + fields: + ackDeadline: {} + expirationPolicy: {} + labels: {} + projectId: {} + pushConfig: {} + retainAckedMessages: {} + retentionDuration: {} + subscriptionName: {} + topic: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.pubsubService.subscription.config.pushconfig: + fields: + attributes: {} + configId: {} + endpoint: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.pubsubService.topic: + fields: + config: {} + name: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.pubsubService.topic.config: + fields: + kmsKeyName: {} + labels: {} + messageStoragePolicy: {} + projectId: {} + topicName: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.pubsubService.topic.config.messagestoragepolicy: + fields: + allowedPersistenceRegions: {} + configId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService: + fields: + instances: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance: + fields: + availableMaintenanceVersions: {} + backendType: {} + connectionName: {} + created: {} + currentDiskSize: {} + databaseInstalledVersion: {} + databaseVersion: {} + databases: {} + diskEncryptionConfiguration: {} + diskEncryptionStatus: {} + failoverReplica: {} + gceZone: {} + instanceType: {} + ipAddresses: {} + maintenanceVersion: {} + masterInstanceName: {} + maxDiskSize: {} + name: {} + project: {} + projectId: {} + region: {} + replicaNames: {} + serviceAccountEmailAddress: {} + settings: {} + state: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance.database: + fields: + charset: {} + collation: {} + instance: {} + name: {} + projectId: {} + sqlserverDatabaseDetails: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance.ipMapping: + fields: + id: {} + ipAddress: {} + timeToRetire: {} + type: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance.settings: + fields: + activationPolicy: {} + activeDirectoryConfig: {} + availabilityType: {} + backupConfiguration: {} + collation: {} + connectorEnforcement: {} + crashSafeReplicationEnabled: {} + dataDiskSizeGb: {} + dataDiskType: {} + databaseFlags: {} + databaseReplicationEnabled: {} + deletionProtectionEnabled: {} + denyMaintenancePeriods: {} + insightsConfig: {} + instanceName: {} + ipConfiguration: {} + locationPreference: {} + maintenanceWindow: {} + passwordValidationPolicy: {} + pricingPlan: {} + projectId: {} + replicationType: {} + settingsVersion: {} + sqlServerAuditConfig: {} + storageAutoResize: {} + storageAutoResizeLimit: {} + tier: {} + timeZone: {} + userLabels: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance.settings.backupconfiguration: + fields: + backupRetentionSettings: {} + binaryLogEnabled: {} + enabled: {} + id: {} + location: {} + pointInTimeRecoveryEnabled: {} + startTime: {} + transactionLogRetentionDays: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance.settings.denyMaintenancePeriod: + fields: + endDate: {} + id: {} + startDate: {} + time: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance.settings.ipConfiguration: + fields: + allocatedIpRange: {} + authorizedNetworks: {} + id: {} + ipv4Enabled: {} + privateNetwork: {} + requireSsl: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance.settings.maintenanceWindow: + fields: + day: {} + hour: {} + id: {} + updateTrack: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.sqlService.instance.settings.passwordValidationPolicy: + fields: + complexity: {} + disallowUsernameSubstring: {} + enabledPasswordPolicy: {} + id: {} + minLength: {} + passwordChangeInterval: {} + reuseInterval: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.storageService: + fields: + buckets: {} + projectId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.project.storageService.bucket: + fields: + created: {} + iamConfiguration: {} + iamPolicy: {} + id: {} + labels: {} + location: {} + locationType: {} + name: {} + projectId: {} + projectNumber: {} + retentionPolicy: {} + storageClass: {} + updated: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.projects: + fields: + children: {} + list: {} + parentId: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.recommendation: + fields: + additionalImpact: {} + category: {} + content: {} + id: {} + lastRefreshTime: {} + name: {} + primaryImpact: {} + priority: {} + projectId: {} + recommender: {} + state: {} + zoneName: {} + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.resourcemanager.binding: + fields: + id: {} + members: {} + role: {} + is_private: true + min_mondoo_version: latest + platform: + name: + - gcloud + gcp.service: + fields: + enabled: {} + name: {} + parentName: {} + projectId: {} + state: {} + title: {} + min_mondoo_version: latest + platform: + name: + - gcloud diff --git a/providers/github/provider/provider.go b/providers/github/provider/provider.go index add03755f9..8818a8a020 100644 --- a/providers/github/provider/provider.go +++ b/providers/github/provider/provider.go @@ -99,6 +99,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.GithubConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/github/resources/github.lr.manifest.yaml b/providers/github/resources/github.lr.manifest.yaml index e4b3b514c1..c377886237 100755 --- a/providers/github/resources/github.lr.manifest.yaml +++ b/providers/github/resources/github.lr.manifest.yaml @@ -38,12 +38,12 @@ resources: headCommit: {} isDefault: min_mondoo_version: 6.8.0 + isProtected: + min_mondoo_version: 8.10.0 name: {} organizationName: {} owner: {} protected: {} - isProtected: - min_mondoo_version: 8.10.0 protectionRules: {} repoName: {} is_private: true @@ -107,6 +107,28 @@ resources: type: {} is_private: true min_mondoo_version: 6.4.0 + github.gist: + fields: + createdAt: {} + description: {} + files: {} + id: {} + owner: {} + public: {} + updatedAt: {} + is_private: true + min_mondoo_version: latest + github.gistfile: + fields: + content: {} + filename: {} + gistId: {} + language: {} + rawUrl: {} + size: {} + type: {} + is_private: true + min_mondoo_version: latest github.installation: fields: appId: {} @@ -116,6 +138,29 @@ resources: updatedAt: {} is_private: true min_mondoo_version: 5.31.0 + github.issue: + fields: + assignees: {} + body: {} + closedAt: {} + closedBy: {} + createdAt: {} + id: {} + number: {} + state: {} + title: {} + updatedAt: {} + url: {} + is_private: true + min_mondoo_version: latest + github.license: + fields: + key: {} + name: {} + spdxId: {} + url: {} + is_private: true + min_mondoo_version: latest github.mergeRequest: fields: assignees: {} @@ -134,6 +179,8 @@ resources: min_mondoo_version: 6.4.0 github.organization: fields: + avatarUrl: + min_mondoo_version: latest billing_email: {} billingEmail: min_mondoo_version: 6.11.0 @@ -151,6 +198,10 @@ resources: diskUsage: min_mondoo_version: 6.11.0 email: {} + followers: + min_mondoo_version: latest + following: + min_mondoo_version: latest id: {} installations: min_mondoo_version: 5.31.0 @@ -324,6 +375,7 @@ resources: min_mondoo_version: 6.11.0 workflows: min_mondoo_version: 6.11.0 + is_private: true min_mondoo_version: 5.31.0 github.review: fields: @@ -348,15 +400,31 @@ resources: min_mondoo_version: 6.11.0 github.user: fields: + avatarUrl: + min_mondoo_version: latest bio: {} + blog: + min_mondoo_version: latest company: min_mondoo_version: 6.4.0 createdAt: {} email: {} + followers: + min_mondoo_version: latest + following: + min_mondoo_version: latest + gists: + min_mondoo_version: latest id: {} + location: + min_mondoo_version: latest login: {} name: {} + repositories: + min_mondoo_version: latest suspendedAt: {} + twitterUsername: + min_mondoo_version: latest updatedAt: {} is_private: true min_mondoo_version: 5.31.0 @@ -381,4 +449,4 @@ resources: state: {} updatedAt: {} is_private: true - min_mondoo_version: 6.11.0 \ No newline at end of file + min_mondoo_version: 6.11.0 diff --git a/providers/gitlab/provider/provider.go b/providers/gitlab/provider/provider.go index 68a0066e59..195cc7036a 100644 --- a/providers/gitlab/provider/provider.go +++ b/providers/gitlab/provider/provider.go @@ -96,6 +96,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.GitLabConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/gitlab/resources/gitlab.lr.manifest.yaml b/providers/gitlab/resources/gitlab.lr.manifest.yaml index 8aae5874a6..41f9749677 100755 --- a/providers/gitlab/resources/gitlab.lr.manifest.yaml +++ b/providers/gitlab/resources/gitlab.lr.manifest.yaml @@ -21,4 +21,4 @@ resources: path: {} visibility: {} maturity: experimental - min_mondoo_version: 5.15.0 \ No newline at end of file + min_mondoo_version: 5.15.0 diff --git a/providers/google-workspace/provider/provider.go b/providers/google-workspace/provider/provider.go index fd1137c467..f81d57061e 100644 --- a/providers/google-workspace/provider/provider.go +++ b/providers/google-workspace/provider/provider.go @@ -152,6 +152,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.GoogleWorkspaceConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/ipmi/provider/provider.go b/providers/ipmi/provider/provider.go index bfdf603e91..f01c0e542f 100644 --- a/providers/ipmi/provider/provider.go +++ b/providers/ipmi/provider/provider.go @@ -110,6 +110,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.IpmiConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/k8s/provider/provider.go b/providers/k8s/provider/provider.go index ae27ef41dd..3351d73fa5 100644 --- a/providers/k8s/provider/provider.go +++ b/providers/k8s/provider/provider.go @@ -124,6 +124,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (shared.Connection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/ms365/provider/provider.go b/providers/ms365/provider/provider.go index 5fa6637189..e4c740270a 100644 --- a/providers/ms365/provider/provider.go +++ b/providers/ms365/provider/provider.go @@ -104,6 +104,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.Ms365Connection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/network/provider/provider.go b/providers/network/provider/provider.go index 5660df46d5..939ac8ef6d 100644 --- a/providers/network/provider/provider.go +++ b/providers/network/provider/provider.go @@ -110,6 +110,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.HostConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/oci/provider/provider.go b/providers/oci/provider/provider.go index 89909088c7..fdefe3af50 100644 --- a/providers/oci/provider/provider.go +++ b/providers/oci/provider/provider.go @@ -129,6 +129,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.OciConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/okta/provider/provider.go b/providers/okta/provider/provider.go index a075f17e9b..188f3e5048 100644 --- a/providers/okta/provider/provider.go +++ b/providers/okta/provider/provider.go @@ -109,6 +109,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.OktaConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/opcua/provider/provider.go b/providers/opcua/provider/provider.go index eb9e044d2d..b47b92bc55 100644 --- a/providers/opcua/provider/provider.go +++ b/providers/opcua/provider/provider.go @@ -85,6 +85,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.OpcuaConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/opcua/resources/opcua.lr.manifest.yaml b/providers/opcua/resources/opcua.lr.manifest.yaml index 86684a2631..e93419516d 100755 --- a/providers/opcua/resources/opcua.lr.manifest.yaml +++ b/providers/opcua/resources/opcua.lr.manifest.yaml @@ -12,6 +12,7 @@ resources: fields: id: {} name: {} + is_private: true min_mondoo_version: latest opcua.node: fields: @@ -30,6 +31,7 @@ resources: properties: {} unit: {} writeable: {} + is_private: true min_mondoo_version: latest opcua.server: fields: diff --git a/providers/os/provider/provider.go b/providers/os/provider/provider.go index 967036f9be..e7ff99bd3b 100644 --- a/providers/os/provider/provider.go +++ b/providers/os/provider/provider.go @@ -222,6 +222,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (shared.Connection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/os/resources/os.lr.manifest.yaml b/providers/os/resources/os.lr.manifest.yaml index a90b170e65..6c9c84af7b 100644 --- a/providers/os/resources/os.lr.manifest.yaml +++ b/providers/os/resources/os.lr.manifest.yaml @@ -2,8 +2,49 @@ # SPDX-License-Identifier: BUSL-1.1 resources: + asset: + fields: + vulnerabilityReport: {} + min_mondoo_version: latest + asset.eol: + fields: + date: {} + docsUrl: {} + productUrl: {} + min_mondoo_version: latest + audit.advisory: + fields: + description: {} + id: {} + modified: {} + mrn: {} + published: {} + title: {} + worstScore: {} + is_private: true + min_mondoo_version: latest + audit.cve: + fields: + id: {} + modified: {} + mrn: {} + published: {} + state: {} + summary: {} + unscored: {} + worstScore: {} + is_private: true + min_mondoo_version: latest + audit.cvss: + fields: + score: {} + vector: {} + is_private: true + min_mondoo_version: latest auditpol: - fields: {} + fields: + list: + min_mondoo_version: latest min_mondoo_version: 5.15.0 snippets: - query: auditpol { inclusionsetting exclusionsetting subcategory } @@ -22,6 +63,22 @@ resources: subcategory: {} subcategoryguid: {} min_mondoo_version: 5.15.0 + authorizedkeys: + fields: + content: {} + file: {} + list: {} + path: {} + min_mondoo_version: latest + authorizedkeys.entry: + fields: + file: {} + key: {} + label: {} + line: {} + options: {} + type: {} + min_mondoo_version: latest command: fields: command: {} @@ -34,6 +91,8 @@ resources: identifier: {} identifierType: {} name: {} + reference: + min_mondoo_version: latest repository: {} min_mondoo_version: 5.31.0 container.repository: @@ -162,15 +221,6 @@ resources: platform: name: - equinix - files.find: - fields: - from: {} - name: {} - permissions: {} - regex: {} - type: {} - xdev: {} - min_mondoo_version: 5.15.0 file: fields: basename: {} @@ -206,12 +256,28 @@ resources: other_writeable: {} sgid: {} sticky: {} + string: + min_mondoo_version: latest suid: {} user_executable: {} user_readable: {} user_writeable: {} is_private: true min_mondoo_version: 5.15.0 + files: + fields: {} + min_mondoo_version: latest + files.find: + fields: + from: {} + list: + min_mondoo_version: latest + name: {} + permissions: {} + regex: {} + type: {} + xdev: {} + min_mondoo_version: 5.15.0 group: fields: gid: {} @@ -220,10 +286,13 @@ resources: sid: {} min_mondoo_version: 5.15.0 groups: - fields: {} + fields: + list: + min_mondoo_version: latest min_mondoo_version: 5.15.0 snippets: - - query: groups.where(name == 'wheel').list { members.all( name != 'username') } + - query: groups.where(name == 'wheel').list { members.all( name != 'username') + } title: Ensure the user is not part of group ip6tables: fields: @@ -272,6 +341,12 @@ resources: name: {} size: {} min_mondoo_version: 5.15.0 + kubelet: + fields: + configFile: {} + configuration: {} + process: {} + min_mondoo_version: latest logindefs: fields: content: {} @@ -279,7 +354,9 @@ resources: params: {} min_mondoo_version: 5.15.0 lsblk: - fields: {} + fields: + list: + min_mondoo_version: latest min_mondoo_version: 5.15.0 lsblk.entry: fields: @@ -374,8 +451,17 @@ resources: fields: preferences: {} min_mondoo_version: 5.15.0 + mondoo.eol: + fields: + date: {} + product: {} + version: {} + is_private: true + min_mondoo_version: latest mount: - fields: {} + fields: + list: + min_mondoo_version: latest min_mondoo_version: 5.15.0 snippets: - query: mount.list { path device fstype options } @@ -459,23 +545,6 @@ resources: restart: {} severity: {} min_mondoo_version: 6.19.0 - pam.conf: - fields: - content: {} - entries: {} - files: {} - services: {} - min_mondoo_version: 5.15.0 - pam.conf.serviceEntry: - fields: - control: {} - lineNumber: {} - module: {} - options: {} - pamType: {} - service: {} - is_private: true - min_mondoo_version: 5.15.0 package: fields: arch: {} @@ -494,12 +563,33 @@ resources: - query: package('git').installed title: Check if a package is installed packages: - fields: {} + fields: + list: + min_mondoo_version: latest + min_mondoo_version: 5.15.0 + pam.conf: + fields: + content: {} + entries: {} + files: {} + services: {} + min_mondoo_version: 5.15.0 + pam.conf.serviceEntry: + fields: + control: {} + lineNumber: {} + module: {} + options: {} + pamType: {} + service: {} + is_private: true min_mondoo_version: 5.15.0 parse.certificates: fields: content: {} file: {} + list: + min_mondoo_version: latest path: {} min_mondoo_version: 5.15.0 snippets: @@ -526,6 +616,13 @@ resources: title: Parse JSON from string content - query: parse.json("/path/to/test.json").params title: Parse JSON from file + parse.openpgp: + fields: + content: {} + file: {} + list: {} + path: {} + min_mondoo_version: latest parse.plist: fields: content: {} @@ -538,17 +635,41 @@ resources: file: {} params: {} min_mondoo_version: 5.15.0 - process: + platform.advisories: fields: - command: {} - executable: {} - flags: {} - pid: {} + cvss: {} + list: {} + stats: {} + min_mondoo_version: latest + platform.cves: + fields: + cvss: {} + list: {} + stats: {} + min_mondoo_version: latest + platform.eol: + fields: + date: {} + docsUrl: {} + productUrl: {} + min_mondoo_version: latest + port: + fields: + address: {} + port: {} + process: {} + protocol: {} + remoteAddress: {} + remotePort: {} state: {} - min_mondoo_version: 5.15.0 - processes: - fields: {} - min_mondoo_version: 5.15.0 + tls: {} + user: {} + min_mondoo_version: latest + ports: + fields: + list: {} + listening: {} + min_mondoo_version: latest powershell: fields: exitcode: {} @@ -569,6 +690,53 @@ resources: stderr == '' } title: Check the timezone + privatekey: + fields: + encrypted: {} + file: {} + path: {} + pem: {} + min_mondoo_version: latest + process: + fields: + command: {} + executable: {} + flags: {} + pid: {} + state: {} + min_mondoo_version: 5.15.0 + processes: + fields: + list: + min_mondoo_version: latest + min_mondoo_version: 5.15.0 + python: + fields: + children: {} + packages: {} + path: {} + toplevel: {} + min_mondoo_version: latest + python.package: + fields: + author: {} + dependencies: {} + file: {} + id: {} + licences: {} + license: {} + licenses: {} + name: {} + path: {} + summary: {} + version: {} + min_mondoo_version: latest + python.packages: + fields: + "": {} + children: {} + packages: {} + min_mondoo_version: latest registrykey: fields: children: {} @@ -593,6 +761,8 @@ resources: fields: content: {} files: {} + path: + min_mondoo_version: latest settings: {} min_mondoo_version: 5.15.0 secpol: @@ -616,10 +786,14 @@ resources: type: {} min_mondoo_version: 5.15.0 services: - fields: {} + fields: + list: + min_mondoo_version: latest min_mondoo_version: 5.15.0 shadow: - fields: {} + fields: + list: + min_mondoo_version: latest min_mondoo_version: 5.15.0 shadow.entry: fields: @@ -641,6 +815,8 @@ resources: ciphers: {} content: {} file: {} + files: + min_mondoo_version: latest hostkeys: {} kexs: {} macs: {} @@ -649,6 +825,23 @@ resources: snippets: - query: sshd.config.params['Banner'] == '/etc/ssh/sshd-banner' title: Check that the SSH banner is sourced from /etc/ssh/sshd-banner + user: + fields: + authorizedkeys: {} + enabled: {} + gid: {} + group: {} + home: {} + name: {} + shell: {} + sid: {} + sshkeys: {} + uid: {} + min_mondoo_version: latest + users: + fields: + list: {} + min_mondoo_version: latest windows: fields: computerInfo: {} @@ -770,7 +963,6 @@ resources: state: {} timestamp: {} type: {} - is_private: true min_mondoo_version: 5.35.0 yaml.path: fields: @@ -805,30 +997,3 @@ resources: enabled } title: Check if a yum repo is enabled - python: - fields: - children: {} - packages: {} - path: {} - toplevel: {} - min_mondoo_version: latest - python.package: - fields: - author: {} - dependencies: {} - file: {} - id: {} - licences: {} - license: {} - licenses: {} - name: {} - path: {} - summary: {} - version: {} - min_mondoo_version: latest - python.packages: - fields: - "": {} - children: {} - packages: {} - min_mondoo_version: latest diff --git a/providers/runtime.go b/providers/runtime.go index 8b23f69800..be2c42910c 100644 --- a/providers/runtime.go +++ b/providers/runtime.go @@ -6,6 +6,7 @@ package providers import ( "errors" "sync" + "time" "github.com/rs/zerolog/log" "go.mondoo.com/cnquery/llx" @@ -17,6 +18,8 @@ import ( "go.mondoo.com/cnquery/utils/multierr" ) +const defaultShutdownTimeout = time.Duration(time.Second * 120) + // Runtimes are associated with one asset and carry all providers // and open connections for that asset. type Runtime struct { @@ -31,8 +34,9 @@ type Runtime struct { // providers for with open connections providers map[string]*ConnectedProvider // schema aggregates all resources executable on this asset - schema extensibleSchema - isClosed bool + schema extensibleSchema + isClosed bool + shutdownTimeout time.Duration } type ConnectedProvider struct { @@ -40,6 +44,12 @@ type ConnectedProvider struct { Connection *plugin.ConnectRes } +func (c *coordinator) RuntimeWithShutdownTimeout(timeout time.Duration) *Runtime { + runtime := c.NewRuntime() + runtime.shutdownTimeout = timeout + return runtime +} + func (c *coordinator) NewRuntime() *Runtime { res := &Runtime{ coordinator: c, @@ -50,7 +60,8 @@ func (c *coordinator) NewRuntime() *Runtime { Resources: map[string]*resources.ResourceInfo{}, }, }, - Recording: nullRecording{}, + Recording: nullRecording{}, + shutdownTimeout: defaultShutdownTimeout, } res.schema.runtime = res @@ -59,6 +70,19 @@ func (c *coordinator) NewRuntime() *Runtime { return res } +type shutdownResult struct { + Response *plugin.ShutdownRes + Error error +} + +func (r *Runtime) tryShutdown() shutdownResult { + resp, err := r.Provider.Instance.Plugin.Shutdown(&plugin.ShutdownReq{}) + return shutdownResult{ + Response: resp, + Error: err, + } +} + func (r *Runtime) Close() { if r.isClosed { return @@ -69,8 +93,20 @@ func (r *Runtime) Close() { log.Error().Err(err).Msg("failed to save recording") } - // TODO: ideally, we try to close the provider here but only if there are no more assets that need it - // r.coordinator.Close(r.Provider.Instance) + response := make(chan shutdownResult, 1) + go func() { + response <- r.tryShutdown() + }() + select { + case <-time.After(r.shutdownTimeout): + log.Error().Str("provider", r.Provider.Instance.Name).Msg("timed out shutting down the provider") + case result := <-response: + if result.Error != nil { + log.Error().Err(result.Error).Msg("failed to shutdown the provider") + } + } + + r.coordinator.Close(r.Provider.Instance) r.schema.Close() } diff --git a/providers/slack/provider/provider.go b/providers/slack/provider/provider.go index b27eb7a615..2b7988a90a 100644 --- a/providers/slack/provider/provider.go +++ b/providers/slack/provider/provider.go @@ -86,6 +86,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.SlackConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/terraform/provider/provider.go b/providers/terraform/provider/provider.go index b31aa0063c..48705c275d 100644 --- a/providers/terraform/provider/provider.go +++ b/providers/terraform/provider/provider.go @@ -116,6 +116,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.Connection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/terraform/resources/terraform.lr.manifest.yaml b/providers/terraform/resources/terraform.lr.manifest.yaml index 1556671c65..9237341a56 100755 --- a/providers/terraform/resources/terraform.lr.manifest.yaml +++ b/providers/terraform/resources/terraform.lr.manifest.yaml @@ -4,122 +4,185 @@ resources: terraform: fields: - blocks: { } - datasources: { } - files: { } - modules: { } - outputs: { } - providers: { } - resources: { } - tfvars: { } - variables: { } + blocks: {} + datasources: {} + files: {} + modules: {} + outputs: {} + providers: {} + resources: {} + tfvars: {} + variables: {} maturity: experimental min_mondoo_version: 5.15.0 platform: name: - - terraform + - terraform snippets: - - query: terraform.blocks { nameLabel arguments } - title: Display all Terraform blocks and their arguments - - query: terraform.datasources { nameLabel arguments } - title: Display all data blocks - - query: terraform.resources { nameLabel arguments } - title: Display all resource blocks + - query: terraform.blocks { nameLabel arguments } + title: Display all Terraform blocks and their arguments + - query: terraform.datasources { nameLabel arguments } + title: Display all data blocks + - query: terraform.resources { nameLabel arguments } + title: Display all resource blocks terraform.block: fields: - arguments: { } - attributes: { } - blocks: { } - end: { } - labels: { } - nameLabel: { } - snippet: { } - start: { } - type: { } + arguments: {} + attributes: {} + blocks: {} + end: {} + labels: {} + nameLabel: {} + snippet: {} + start: {} + type: {} maturity: experimental min_mondoo_version: 5.15.0 platform: name: - - terraform + - terraform snippets: - - query: terraform.blocks { nameLabel arguments } - title: Display all Terraform blocks and their arguments + - query: terraform.blocks { nameLabel arguments } + title: Display all Terraform blocks and their arguments terraform.file: fields: - blocks: { } - path: { } + blocks: {} + path: {} maturity: experimental min_mondoo_version: 5.15.0 platform: name: - - terraform + - terraform snippets: - - query: terraform.files { path blocks { nameLabel } } - title: Display all files and their blocks + - query: terraform.files { path blocks { nameLabel } } + title: Display all files and their blocks terraform.fileposition: fields: - byte: { } - column: { } - line: { } - path: { } + byte: {} + column: {} + line: {} + path: {} maturity: experimental min_mondoo_version: 5.15.0 platform: name: - - terraform + - terraform terraform.module: fields: - dir: { } - key: { } - source: { } - version: { } + block: + min_mondoo_version: latest + dir: {} + key: {} + source: {} + version: {} maturity: experimental min_mondoo_version: 5.15.0 platform: name: - - terraform + - terraform snippets: - - query: terraform.modules { key version source} - title: Display all loaded Terraform modules + - query: terraform.modules { key version source} + title: Display all loaded Terraform modules + terraform.plan: + fields: + formatVersion: {} + resourceChanges: {} + terraformVersion: {} + min_mondoo_version: latest + platform: + name: + - terraform + terraform.plan.configuration: + fields: + providerConfig: {} + resources: {} + min_mondoo_version: latest + platform: + name: + - terraform + terraform.plan.proposedChange: + fields: + actions: {} + address: {} + after: {} + afterSensitive: {} + afterUnknown: {} + before: {} + beforeSensitive: {} + replacePaths: {} + min_mondoo_version: latest + platform: + name: + - terraform + terraform.plan.resourceChange: + fields: + actionReason: {} + address: {} + change: {} + deposed: {} + mode: {} + moduleAddress: {} + name: {} + previousAddress: {} + providerName: {} + type: {} + min_mondoo_version: latest + platform: + name: + - terraform terraform.settings: fields: - block: { } - requiredProviders: { } + block: {} + requiredProviders: {} min_mondoo_version: 5.31.0 platform: name: - - terraform + - terraform terraform.state: fields: - formatVersion: { } - modules: { } - outputs: { } - rootModule: { } - terraformVersion: { } + formatVersion: {} + modules: {} + outputs: {} + resources: + min_mondoo_version: latest + rootModule: {} + terraformVersion: {} min_mondoo_version: 6.11.0 + platform: + name: + - terraform terraform.state.module: fields: - address: { } - childModules: { } - resources: { } + address: {} + childModules: {} + resources: {} min_mondoo_version: 6.11.0 + platform: + name: + - terraform terraform.state.output: fields: - identifier: { } - sensitive: { } - type: { } - value: { } + identifier: {} + sensitive: {} + type: {} + value: {} min_mondoo_version: 6.11.0 + platform: + name: + - terraform terraform.state.resource: fields: - address: { } - dependsOn: { } - deposedKey: { } - mode: { } - name: { } - providerName: { } - schemaVersion: { } - tainted: { } - type: { } - values: { } - min_mondoo_version: 6.11.0 \ No newline at end of file + address: {} + dependsOn: {} + deposedKey: {} + mode: {} + name: {} + providerName: {} + schemaVersion: {} + tainted: {} + type: {} + values: {} + min_mondoo_version: 6.11.0 + platform: + name: + - terraform diff --git a/providers/vcd/provider/provider.go b/providers/vcd/provider/provider.go index 7815572821..24c76f9067 100644 --- a/providers/vcd/provider/provider.go +++ b/providers/vcd/provider/provider.go @@ -99,6 +99,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.VcdConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/vcd/resources/vcd.lr.manifest.yaml b/providers/vcd/resources/vcd.lr.manifest.yaml index 1617993ec1..8f4e136764 100755 --- a/providers/vcd/resources/vcd.lr.manifest.yaml +++ b/providers/vcd/resources/vcd.lr.manifest.yaml @@ -136,6 +136,7 @@ resources: netmask: {} operationKey: {} type: {} + urn: {} is_private: true min_mondoo_version: latest vcd.networkPool: diff --git a/providers/vsphere/provider/provider.go b/providers/vsphere/provider/provider.go index f15328ac2c..60684b56fb 100644 --- a/providers/vsphere/provider/provider.go +++ b/providers/vsphere/provider/provider.go @@ -112,6 +112,13 @@ func (s *Service) Connect(req *plugin.ConnectReq, callback plugin.ProviderCallba }, nil } +// Shutdown is automatically called when the shell closes. +// It is not necessary to implement this method. +// If you want to do some cleanup, you can do it here. +func (s *Service) Shutdown(req *plugin.ShutdownReq) (*plugin.ShutdownRes, error) { + return &plugin.ShutdownRes{}, nil +} + func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallback) (*connection.VsphereConnection, error) { if len(req.Asset.Connections) == 0 { return nil, errors.New("no connection options for asset") diff --git a/providers/vsphere/resources/vsphere.lr.manifest.yaml b/providers/vsphere/resources/vsphere.lr.manifest.yaml index 5f155db7f5..d9c92ef7f2 100644 --- a/providers/vsphere/resources/vsphere.lr.manifest.yaml +++ b/providers/vsphere/resources/vsphere.lr.manifest.yaml @@ -13,16 +13,16 @@ resources: min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere snippets: - - query: | - esxi.host { - kernelModules { - signedStatus == "Signed" - } + - query: | + esxi.host { + kernelModules { + signedStatus == "Signed" } - title: Check that all kernel modules are signed + } + title: Check that all kernel modules are signed esxi.command: fields: command: {} @@ -31,8 +31,8 @@ resources: min_mondoo_version: 5.27.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere esxi.kernelmodule: fields: enabled: {} @@ -45,21 +45,23 @@ resources: signedStatus: {} version: {} vibAcceptanceLevel: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere esxi.ntpconfig: fields: config: {} id: {} server: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere esxi.service: fields: key: {} @@ -69,22 +71,24 @@ resources: ruleset: {} running: {} uninstallable: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere esxi.timezone: fields: description: {} key: {} name: {} offset: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere esxi.vib: fields: acceptanceLevel: {} @@ -95,11 +99,12 @@ resources: status: {} vendor: {} version: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere vsphere: fields: about: {} @@ -108,28 +113,28 @@ resources: min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere snippets: - - query: vsphere.about - title: Display Information about the vSphere environment - - query: vsphere.datacenters { hosts { moid properties } } - title: Display ESXi host moid and properties - - query: vsphere.datacenters { hosts { ntp.server } } - title: Display NTP server for all ESXi hosts - - query: vsphere.datacenters { hosts { ntp.server.any(_ == "10.31.21.2") } } - title: Ensure a specific NTP Server is set - - query: | - vsphere.datacenters { - hosts { - vmknics.where(tags == "Management") { - properties['Enabled'] == true - properties['MTU'] == 1500 - properties['VDSName'] != /(?i)storage/ - } + - query: vsphere.about + title: Display Information about the vSphere environment + - query: vsphere.datacenters { hosts { moid properties } } + title: Display ESXi host moid and properties + - query: vsphere.datacenters { hosts { ntp.server } } + title: Display NTP server for all ESXi hosts + - query: vsphere.datacenters { hosts { ntp.server.any(_ == "10.31.21.2") } } + title: Ensure a specific NTP Server is set + - query: | + vsphere.datacenters { + hosts { + vmknics.where(tags == "Management") { + properties['Enabled'] == true + properties['MTU'] == 1500 + properties['VDSName'] != /(?i)storage/ } } - title: Ensure specific VmkNics properties for all management VmkNics + } + title: Ensure specific VmkNics properties for all management VmkNics vsphere.cluster: fields: hosts: {} @@ -137,11 +142,12 @@ resources: moid: {} name: {} properties: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere vsphere.datacenter: fields: clusters: {} @@ -150,11 +156,12 @@ resources: moid: {} name: {} vms: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere vsphere.host: fields: acceptanceLevel: {} @@ -173,42 +180,44 @@ resources: standardSwitch: {} timezone: {} vmknics: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere snippets: - - query: | - // targeting a single ESXi host - esxi.host { + - query: | + // targeting a single ESXi host + esxi.host { + acceptanceLevel == 'VMwareCertified' || acceptanceLevel == 'VMwareAccepted' || acceptanceLevel == 'PartnerSupported' + } + + // targeting the vSphere API + vsphere.datacenters { + hosts { acceptanceLevel == 'VMwareCertified' || acceptanceLevel == 'VMwareAccepted' || acceptanceLevel == 'PartnerSupported' } - - // targeting the vSphere API - vsphere.datacenters { - hosts { - acceptanceLevel == 'VMwareCertified' || acceptanceLevel == 'VMwareAccepted' || acceptanceLevel == 'PartnerSupported' - } - } - title: Verify the Software AcceptanceLevel for ESXi host - - query: | - esxi.host { - packages { - acceptanceLevel == 'VMwareCertified' || acceptanceLevel == 'VMwareAccepted' || acceptanceLevel == 'PartnerSupported' - } + } + title: Verify the Software AcceptanceLevel for ESXi host + - query: | + esxi.host { + packages { + acceptanceLevel == 'VMwareCertified' || acceptanceLevel == 'VMwareAccepted' || acceptanceLevel == 'PartnerSupported' } - title: Verify that each vib is "VMwareCertified" or "VMwareAccepted" + } + title: Verify that each vib is "VMwareCertified" or "VMwareAccepted" vsphere.license: fields: name: {} total: {} used: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere vsphere.vm: fields: advancedSettings: {} @@ -216,11 +225,12 @@ resources: moid: {} name: {} properties: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere vsphere.vmknic: fields: ipv4: {} @@ -228,32 +238,35 @@ resources: name: {} properties: {} tags: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere vsphere.vmnic: fields: details: {} name: {} pauseParams: {} properties: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere vsphere.vswitch.dvs: fields: name: {} properties: {} uplinks: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere + - vmware-esxi + - vmware-vsphere vsphere.vswitch.standard: fields: failoverPolicy: {} @@ -262,8 +275,9 @@ resources: securityPolicy: {} shapingPolicy: {} uplinks: {} + is_private: true min_mondoo_version: 5.15.0 platform: name: - - vmware-esxi - - vmware-vsphere \ No newline at end of file + - vmware-esxi + - vmware-vsphere diff --git a/shared/proto/cnquery.pb.go b/shared/proto/cnquery.pb.go index d96a13616e..0ccf6cdd9b 100644 --- a/shared/proto/cnquery.pb.go +++ b/shared/proto/cnquery.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.23.4 +// protoc v4.24.2 // source: cnquery.proto package proto diff --git a/shared/proto/cnquery_grpc.pb.go b/shared/proto/cnquery_grpc.pb.go index 6707d7ab6c..bd04e4c53d 100644 --- a/shared/proto/cnquery_grpc.pb.go +++ b/shared/proto/cnquery_grpc.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc v4.24.2 // source: cnquery.proto package proto