From 630f4a45b0404d04e67f26215280d7042f8b19ba Mon Sep 17 00:00:00 2001 From: Marco Dinis Date: Tue, 20 Aug 2024 11:18:55 +0100 Subject: [PATCH] Add DiscoveryConfigStatus AWS EC2 resource counters (proto) This PR adds counters for AWS Instances found/enrolled/failed for a given DiscoveryConfig and Integration. --- .../discoveryconfig/v1/discoveryconfig.pb.go | 214 ++++++++++++++---- .../discoveryconfig/v1/discoveryconfig.proto | 17 ++ 2 files changed, 183 insertions(+), 48 deletions(-) diff --git a/api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go b/api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go index eb5da13e3d26d..d1069fb37b3b7 100644 --- a/api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go +++ b/api/gen/proto/go/teleport/discoveryconfig/v1/discoveryconfig.pb.go @@ -275,6 +275,8 @@ type DiscoveryConfigStatus struct { DiscoveredResources uint64 `protobuf:"varint,3,opt,name=discovered_resources,json=discoveredResources,proto3" json:"discovered_resources,omitempty"` // last_sync_time is the timestamp when the Discovery Config was last sync. LastSyncTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_sync_time,json=lastSyncTime,proto3" json:"last_sync_time,omitempty"` + // AWSEC2ResourcesDiscovered contains all the AWS EC2 instances discovered. + AwsEc2ResourcesDiscovered []*AWSResourcesDiscoveredSummary `protobuf:"bytes,6,rep,name=aws_ec2_resources_discovered,json=awsEc2ResourcesDiscovered,proto3" json:"aws_ec2_resources_discovered,omitempty"` } func (x *DiscoveryConfigStatus) Reset() { @@ -337,6 +339,91 @@ func (x *DiscoveryConfigStatus) GetLastSyncTime() *timestamppb.Timestamp { return nil } +func (x *DiscoveryConfigStatus) GetAwsEc2ResourcesDiscovered() []*AWSResourcesDiscoveredSummary { + if x != nil { + return x.AwsEc2ResourcesDiscovered + } + return nil +} + +// AWSResourcesDiscoveredSummary represents the AWS resources that were discovered. +type AWSResourcesDiscoveredSummary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Integration is the Integration name used to fetch the resource. + // Integration is empty if using ambient credentials. + Integration string `protobuf:"bytes,1,opt,name=integration,proto3" json:"integration,omitempty"` + // Found holds the count of resources found. + // After a resource is found, it starts the sync process and ends in either an enrolled or a failed resource. + Found uint64 `protobuf:"varint,2,opt,name=found,proto3" json:"found,omitempty"` + // Enrolled holds the count of the resources that were successfully enrolled. + Enrolled uint64 `protobuf:"varint,3,opt,name=enrolled,proto3" json:"enrolled,omitempty"` + // Failed holds the count of the resources that failed to enroll. + Failed uint64 `protobuf:"varint,4,opt,name=failed,proto3" json:"failed,omitempty"` +} + +func (x *AWSResourcesDiscoveredSummary) Reset() { + *x = AWSResourcesDiscoveredSummary{} + if protoimpl.UnsafeEnabled { + mi := &file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AWSResourcesDiscoveredSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AWSResourcesDiscoveredSummary) ProtoMessage() {} + +func (x *AWSResourcesDiscoveredSummary) ProtoReflect() protoreflect.Message { + mi := &file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AWSResourcesDiscoveredSummary.ProtoReflect.Descriptor instead. +func (*AWSResourcesDiscoveredSummary) Descriptor() ([]byte, []int) { + return file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDescGZIP(), []int{3} +} + +func (x *AWSResourcesDiscoveredSummary) GetIntegration() string { + if x != nil { + return x.Integration + } + return "" +} + +func (x *AWSResourcesDiscoveredSummary) GetFound() uint64 { + if x != nil { + return x.Found + } + return 0 +} + +func (x *AWSResourcesDiscoveredSummary) GetEnrolled() uint64 { + if x != nil { + return x.Enrolled + } + return 0 +} + +func (x *AWSResourcesDiscoveredSummary) GetFailed() uint64 { + if x != nil { + return x.Failed + } + return 0 +} + var File_teleport_discoveryconfig_v1_discoveryconfig_proto protoreflect.FileDescriptor var file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDesc = []byte{ @@ -383,8 +470,8 @@ var file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDesc = []byte{ 0x75, 0x62, 0x65, 0x12, 0x39, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x70, 0x68, 0x53, 0x79, 0x6e, - 0x63, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x70, 0x68, 0x22, 0xb5, - 0x02, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, + 0x63, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x47, 0x72, 0x61, 0x70, 0x68, 0x22, 0xb2, + 0x03, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x63, 0x6f, 0x6e, 0x66, @@ -400,27 +487,44 @@ var file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDesc = []byte{ 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, - 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x52, 0x1c, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x63, - 0x32, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x63, - 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x2a, 0xa8, 0x01, 0x0a, 0x14, 0x44, 0x69, 0x73, 0x63, 0x6f, - 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, - 0x26, 0x0a, 0x22, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x43, 0x4f, 0x4e, - 0x46, 0x49, 0x47, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x44, 0x49, 0x53, 0x43, 0x4f, - 0x56, 0x45, 0x52, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x44, - 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, - 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x12, 0x22, 0x0a, - 0x1e, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, - 0x47, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, - 0x03, 0x42, 0x62, 0x5a, 0x60, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x67, 0x72, 0x61, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, - 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x7b, 0x0a, 0x1c, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x63, 0x32, 0x5f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x57, 0x53, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x53, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x52, 0x19, 0x61, 0x77, 0x73, 0x45, 0x63, 0x32, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x42, 0x10, 0x0a, + 0x0e, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4a, + 0x04, 0x08, 0x05, 0x10, 0x06, 0x52, 0x1c, 0x61, 0x77, 0x73, 0x5f, 0x65, 0x63, 0x32, 0x5f, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x65, 0x64, 0x22, 0x8b, 0x01, 0x0a, 0x1d, 0x41, 0x57, 0x53, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x53, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x74, 0x65, + 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x65, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x65, 0x6e, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x61, 0x69, + 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x66, 0x61, 0x69, 0x6c, 0x65, + 0x64, 0x2a, 0xa8, 0x01, 0x0a, 0x14, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x22, 0x44, 0x49, + 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, 0x45, 0x52, 0x59, 0x5f, + 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e, + 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x44, 0x49, 0x53, 0x43, 0x4f, 0x56, + 0x45, 0x52, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, 0x44, 0x49, 0x53, 0x43, + 0x4f, 0x56, 0x45, 0x52, 0x59, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x49, 0x4e, 0x47, 0x10, 0x03, 0x42, 0x62, 0x5a, 0x60, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x76, 0x69, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -436,36 +540,38 @@ func file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDescGZIP() []byte } var file_teleport_discoveryconfig_v1_discoveryconfig_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_teleport_discoveryconfig_v1_discoveryconfig_proto_goTypes = []any{ - (DiscoveryConfigState)(0), // 0: teleport.discoveryconfig.v1.DiscoveryConfigState - (*DiscoveryConfig)(nil), // 1: teleport.discoveryconfig.v1.DiscoveryConfig - (*DiscoveryConfigSpec)(nil), // 2: teleport.discoveryconfig.v1.DiscoveryConfigSpec - (*DiscoveryConfigStatus)(nil), // 3: teleport.discoveryconfig.v1.DiscoveryConfigStatus - (*v1.ResourceHeader)(nil), // 4: teleport.header.v1.ResourceHeader - (*types.AWSMatcher)(nil), // 5: types.AWSMatcher - (*types.AzureMatcher)(nil), // 6: types.AzureMatcher - (*types.GCPMatcher)(nil), // 7: types.GCPMatcher - (*types.KubernetesMatcher)(nil), // 8: types.KubernetesMatcher - (*types.AccessGraphSync)(nil), // 9: types.AccessGraphSync - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp + (DiscoveryConfigState)(0), // 0: teleport.discoveryconfig.v1.DiscoveryConfigState + (*DiscoveryConfig)(nil), // 1: teleport.discoveryconfig.v1.DiscoveryConfig + (*DiscoveryConfigSpec)(nil), // 2: teleport.discoveryconfig.v1.DiscoveryConfigSpec + (*DiscoveryConfigStatus)(nil), // 3: teleport.discoveryconfig.v1.DiscoveryConfigStatus + (*AWSResourcesDiscoveredSummary)(nil), // 4: teleport.discoveryconfig.v1.AWSResourcesDiscoveredSummary + (*v1.ResourceHeader)(nil), // 5: teleport.header.v1.ResourceHeader + (*types.AWSMatcher)(nil), // 6: types.AWSMatcher + (*types.AzureMatcher)(nil), // 7: types.AzureMatcher + (*types.GCPMatcher)(nil), // 8: types.GCPMatcher + (*types.KubernetesMatcher)(nil), // 9: types.KubernetesMatcher + (*types.AccessGraphSync)(nil), // 10: types.AccessGraphSync + (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp } var file_teleport_discoveryconfig_v1_discoveryconfig_proto_depIdxs = []int32{ - 4, // 0: teleport.discoveryconfig.v1.DiscoveryConfig.header:type_name -> teleport.header.v1.ResourceHeader + 5, // 0: teleport.discoveryconfig.v1.DiscoveryConfig.header:type_name -> teleport.header.v1.ResourceHeader 2, // 1: teleport.discoveryconfig.v1.DiscoveryConfig.spec:type_name -> teleport.discoveryconfig.v1.DiscoveryConfigSpec 3, // 2: teleport.discoveryconfig.v1.DiscoveryConfig.status:type_name -> teleport.discoveryconfig.v1.DiscoveryConfigStatus - 5, // 3: teleport.discoveryconfig.v1.DiscoveryConfigSpec.aws:type_name -> types.AWSMatcher - 6, // 4: teleport.discoveryconfig.v1.DiscoveryConfigSpec.azure:type_name -> types.AzureMatcher - 7, // 5: teleport.discoveryconfig.v1.DiscoveryConfigSpec.gcp:type_name -> types.GCPMatcher - 8, // 6: teleport.discoveryconfig.v1.DiscoveryConfigSpec.kube:type_name -> types.KubernetesMatcher - 9, // 7: teleport.discoveryconfig.v1.DiscoveryConfigSpec.access_graph:type_name -> types.AccessGraphSync + 6, // 3: teleport.discoveryconfig.v1.DiscoveryConfigSpec.aws:type_name -> types.AWSMatcher + 7, // 4: teleport.discoveryconfig.v1.DiscoveryConfigSpec.azure:type_name -> types.AzureMatcher + 8, // 5: teleport.discoveryconfig.v1.DiscoveryConfigSpec.gcp:type_name -> types.GCPMatcher + 9, // 6: teleport.discoveryconfig.v1.DiscoveryConfigSpec.kube:type_name -> types.KubernetesMatcher + 10, // 7: teleport.discoveryconfig.v1.DiscoveryConfigSpec.access_graph:type_name -> types.AccessGraphSync 0, // 8: teleport.discoveryconfig.v1.DiscoveryConfigStatus.state:type_name -> teleport.discoveryconfig.v1.DiscoveryConfigState - 10, // 9: teleport.discoveryconfig.v1.DiscoveryConfigStatus.last_sync_time:type_name -> google.protobuf.Timestamp - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 11, // 9: teleport.discoveryconfig.v1.DiscoveryConfigStatus.last_sync_time:type_name -> google.protobuf.Timestamp + 4, // 10: teleport.discoveryconfig.v1.DiscoveryConfigStatus.aws_ec2_resources_discovered:type_name -> teleport.discoveryconfig.v1.AWSResourcesDiscoveredSummary + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_teleport_discoveryconfig_v1_discoveryconfig_proto_init() } @@ -510,6 +616,18 @@ func file_teleport_discoveryconfig_v1_discoveryconfig_proto_init() { return nil } } + file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[3].Exporter = func(v any, i int) any { + switch v := v.(*AWSResourcesDiscoveredSummary); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_teleport_discoveryconfig_v1_discoveryconfig_proto_msgTypes[2].OneofWrappers = []any{} type x struct{} @@ -518,7 +636,7 @@ func file_teleport_discoveryconfig_v1_discoveryconfig_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_teleport_discoveryconfig_v1_discoveryconfig_proto_rawDesc, NumEnums: 1, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto b/api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto index c0c8560db017a..f8af143f99454 100644 --- a/api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto +++ b/api/proto/teleport/discoveryconfig/v1/discoveryconfig.proto @@ -69,6 +69,9 @@ message DiscoveryConfigStatus { reserved 5; reserved "aws_ec2_instances_discovered"; + + // AWSEC2ResourcesDiscovered contains all the AWS EC2 instances discovered. + repeated AWSResourcesDiscoveredSummary aws_ec2_resources_discovered = 6; } // DiscoveryConfigState is the state of the discovery config resource. @@ -83,3 +86,17 @@ enum DiscoveryConfigState { // DISCOVERY_CONFIG_STATE_SYNCING is used when the discovery process has started but didn't finished yet. DISCOVERY_CONFIG_STATE_SYNCING = 3; } + +// AWSResourcesDiscoveredSummary represents the AWS resources that were discovered. +message AWSResourcesDiscoveredSummary { + // Integration is the Integration name used to fetch the resource. + // Integration is empty if using ambient credentials. + string integration = 1; + // Found holds the count of resources found. + // After a resource is found, it starts the sync process and ends in either an enrolled or a failed resource. + uint64 found = 2; + // Enrolled holds the count of the resources that were successfully enrolled. + uint64 enrolled = 3; + // Failed holds the count of the resources that failed to enroll. + uint64 failed = 4; +}