From 40477182447040f4523abc1de35d9e517c0b0414 Mon Sep 17 00:00:00 2001 From: yasin-cs-ko-ak Date: Mon, 5 Dec 2022 17:22:03 +0530 Subject: [PATCH] bind port connection details --- src/observability/kubearmor.go | 4 +- src/observability/summarizer.go | 27 ++- src/observability/summary.go | 18 +- .../v1/observability/observability.pb.go | 169 +++++++++++------- .../v1/observability/observability.proto | 4 + .../v1/observability/observability_grpc.pb.go | 2 +- src/types/observability.go | 19 +- 7 files changed, 164 insertions(+), 79 deletions(-) diff --git a/src/observability/kubearmor.go b/src/observability/kubearmor.go index 874925f9..737c44b3 100644 --- a/src/observability/kubearmor.go +++ b/src/observability/kubearmor.go @@ -268,11 +268,13 @@ func GetKubearmorSummaryData(req *opb.Request) ([]types.SysObsProcFileData, []ty } else if ss.Operation == "Network" { //ExtractNwData nwData = append(nwData, types.SysObsNwData{ - InOut: ss.NwType, + NetType: ss.NwType, Protocol: ss.Protocol, Command: ss.Source, PodSvcIP: ss.IP, ServerPort: strconv.Itoa(int(ss.Port)), + BindPort: ss.BindPort, + BindAddress: ss.BindAddress, Namespace: ss.DestNamespace, Labels: ss.DestLabels, Count: uint32(ss.Count), diff --git a/src/observability/summarizer.go b/src/observability/summarizer.go index c9297f25..01a55fa8 100644 --- a/src/observability/summarizer.go +++ b/src/observability/summarizer.go @@ -11,16 +11,18 @@ import ( pb "github.com/kubearmor/KubeArmor/protobuf" ) -func extractNetworkInfoFromSystemLog(netLog pb.Log) (string, string, string, string, string, string, error) { - var ip, destNs, destLabel, port, protocol, nwrule string = "", "", "", "", "", "" +func extractNetworkInfoFromSystemLog(netLog pb.Log) (string, string, string, string, string, string, string, string, error) { + var ip, destNs, destLabel, port, bindPort, bindAddress, protocol, nwrule string = "", "", "", "", "", "", "", "" err := errors.New("not a valid incoming/outgoing connection") if strings.Contains(netLog.Data, "tcp_connect") || strings.Contains(netLog.Data, "SYS_CONNECT") { nwrule = "egress" } else if strings.Contains(netLog.Data, "tcp_accept") { nwrule = "ingress" + } else if strings.Contains(netLog.Data, "SYS_BIND") { + nwrule = "bind" } else { - return ip, destNs, destLabel, port, protocol, nwrule, err + return ip, destNs, destLabel, port, bindPort, bindAddress, protocol, nwrule, err } if strings.Contains(netLog.Data, "tcp_") { @@ -49,11 +51,22 @@ func extractNetworkInfoFromSystemLog(netLog pb.Log) (string, string, string, str } } } + } else if strings.Contains(netLog.Data, "SYS_BIND") { + resslice := strings.Split(netLog.Resource, " ") + for _, locres := range resslice { + if strings.Contains(locres, "sin_port") { + bindPort = strings.Split(locres, "=")[1] + } + if strings.Contains(locres, "sin_addr") { + bindAddress = strings.Split(locres, "=")[1] + } + } + } else { - return "", "", "", "", "", "", err + return "", "", "", "", "", "", "", "", err } - return ip, destNs, destLabel, port, protocol, nwrule, nil + return ip, destNs, destLabel, port, bindPort, bindAddress, protocol, nwrule, nil } func convertSysLogToSysSummaryMap(syslogs []*pb.Log) { @@ -111,7 +124,7 @@ func convertSysLogToSysSummaryMap(syslogs []*pb.Log) { } if syslog.Operation == "Network" { - ip, destNs, destLabel, portStr, protocol, nwrule, err := extractNetworkInfoFromSystemLog(*syslog) + ip, destNs, destLabel, portStr, bindPort, bindAddress, protocol, nwrule, err := extractNetworkInfoFromSystemLog(*syslog) if err != nil { continue } @@ -119,6 +132,8 @@ func convertSysLogToSysSummaryMap(syslogs []*pb.Log) { sysSummary.NwType = nwrule sysSummary.IP = ip sysSummary.Port = int32(port) + sysSummary.BindPort = bindPort + sysSummary.BindAddress = bindAddress sysSummary.Protocol = protocol sysSummary.DestNamespace = destNs sysSummary.DestLabels = destLabel diff --git a/src/observability/summary.go b/src/observability/summary.go index e967a23b..3f20c011 100644 --- a/src/observability/summary.go +++ b/src/observability/summary.go @@ -24,6 +24,7 @@ func GetSummaryData(request *opb.Request) (*opb.Response, error) { fileResp := []*opb.SysProcFileSummaryData{} inNwResp := []*opb.SysNwSummaryData{} outNwResp := []*opb.SysNwSummaryData{} + bindNwResp := []*opb.SysNwSummaryData{} resp.PodName = podInfo.PodName resp.ClusterName = podInfo.ClusterName @@ -57,7 +58,7 @@ func GetSummaryData(request *opb.Request) (*opb.Response, error) { if len(nw) > 0 && strings.Contains(request.Type, "network") { for _, loc_nw := range nw { - if loc_nw.InOut == "ingress" { + if loc_nw.NetType == "ingress" { inNwResp = append(inNwResp, &opb.SysNwSummaryData{ Protocol: loc_nw.Protocol, Command: loc_nw.Command, @@ -68,7 +69,7 @@ func GetSummaryData(request *opb.Request) (*opb.Response, error) { Count: strconv.Itoa(int(loc_nw.Count)), UpdatedTime: loc_nw.UpdatedTime, }) - } else if loc_nw.InOut == "egress" { + } else if loc_nw.NetType == "egress" { outNwResp = append(outNwResp, &opb.SysNwSummaryData{ Protocol: loc_nw.Protocol, Command: loc_nw.Command, @@ -79,6 +80,18 @@ func GetSummaryData(request *opb.Request) (*opb.Response, error) { Count: strconv.Itoa(int(loc_nw.Count)), UpdatedTime: loc_nw.UpdatedTime, }) + } else if loc_nw.NetType == "bind" { + bindNwResp = append(bindNwResp, &opb.SysNwSummaryData{ + Protocol: loc_nw.Protocol, + Command: loc_nw.Command, + IP: loc_nw.PodSvcIP, + BindPort: loc_nw.BindPort, + BindAddress: loc_nw.BindAddress, + Labels: loc_nw.Labels, + Namespace: loc_nw.Namespace, + Count: strconv.Itoa(int(loc_nw.Count)), + UpdatedTime: loc_nw.UpdatedTime, + }) } } } @@ -86,6 +99,7 @@ func GetSummaryData(request *opb.Request) (*opb.Response, error) { resp.FileData = fileResp resp.IngressConnection = inNwResp resp.EgressConnection = outNwResp + resp.BindConnection = bindNwResp } if strings.Contains(request.Type, "ingress") || strings.Contains(request.Type, "egress") { diff --git a/src/protobuf/v1/observability/observability.pb.go b/src/protobuf/v1/observability/observability.pb.go index d7186dd0..cc166ec5 100644 --- a/src/protobuf/v1/observability/observability.pb.go +++ b/src/protobuf/v1/observability/observability.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.15.8 +// protoc v3.19.6 // source: v1/observability/observability.proto package observability @@ -131,6 +131,7 @@ type Response struct { EgressConnection []*SysNwSummaryData `protobuf:"bytes,9,rep,name=EgressConnection,proto3" json:"EgressConnection,omitempty"` IngressData []*CiliumSummData `protobuf:"bytes,10,rep,name=IngressData,proto3" json:"IngressData,omitempty"` EgressData []*CiliumSummData `protobuf:"bytes,11,rep,name=EgressData,proto3" json:"EgressData,omitempty"` + BindConnection []*SysNwSummaryData `protobuf:"bytes,12,rep,name=BindConnection,proto3" json:"BindConnection,omitempty"` } func (x *Response) Reset() { @@ -242,6 +243,13 @@ func (x *Response) GetEgressData() []*CiliumSummData { return nil } +func (x *Response) GetBindConnection() []*SysNwSummaryData { + if x != nil { + return x.BindConnection + } + return nil +} + type SysProcFileSummaryData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -334,6 +342,8 @@ type SysNwSummaryData struct { Namespace string `protobuf:"bytes,6,opt,name=Namespace,proto3" json:"Namespace,omitempty"` Count string `protobuf:"bytes,7,opt,name=Count,proto3" json:"Count,omitempty"` UpdatedTime string `protobuf:"bytes,8,opt,name=UpdatedTime,proto3" json:"UpdatedTime,omitempty"` + BindPort string `protobuf:"bytes,9,opt,name=BindPort,proto3" json:"BindPort,omitempty"` + BindAddress string `protobuf:"bytes,10,opt,name=BindAddress,proto3" json:"BindAddress,omitempty"` } func (x *SysNwSummaryData) Reset() { @@ -424,6 +434,20 @@ func (x *SysNwSummaryData) GetUpdatedTime() string { return "" } +func (x *SysNwSummaryData) GetBindPort() string { + if x != nil { + return x.BindPort + } + return "" +} + +func (x *SysNwSummaryData) GetBindAddress() string { + if x != nil { + return x.BindAddress + } + return "" +} + type CiliumSummData struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -601,7 +625,7 @@ var file_v1_observability_observability_proto_rawDesc = []byte{ 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0xda, 0x04, 0x0a, + 0x08, 0x52, 0x09, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x22, 0xa6, 0x05, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, @@ -639,66 +663,74 @@ var file_v1_observability_observability_proto_rawDesc = []byte{ 0x73, 0x44, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x43, 0x69, 0x6c, 0x69, 0x75, 0x6d, 0x53, 0x75, 0x6d, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x45, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x22, 0xa2, 0x01, 0x0a, 0x16, 0x53, 0x79, - 0x73, 0x50, 0x72, 0x6f, 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, - 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x43, + 0x67, 0x72, 0x65, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4a, 0x0a, 0x0e, 0x42, 0x69, 0x6e, + 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x22, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x53, 0x79, 0x73, 0x4e, 0x77, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, + 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x42, 0x69, 0x6e, 0x64, 0x43, 0x6f, 0x6e, 0x6e, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa2, 0x01, 0x0a, 0x16, 0x53, 0x79, 0x73, 0x50, 0x72, 0x6f, + 0x63, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x44, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x20, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x98, 0x02, 0x0a, 0x10, 0x53, + 0x79, 0x73, 0x4e, 0x77, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x50, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x49, 0x50, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x42, 0x69, 0x6e, 0x64, 0x50, + 0x6f, 0x72, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x42, 0x69, 0x6e, 0x64, 0x50, + 0x6f, 0x72, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x42, 0x69, 0x6e, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x42, 0x69, 0x6e, 0x64, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x86, 0x02, 0x0a, 0x0e, 0x43, 0x69, 0x6c, 0x69, 0x75, 0x6d, + 0x53, 0x75, 0x6d, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x72, 0x63, 0x50, + 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x72, 0x63, 0x50, 0x6f, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x44, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x44, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x65, + 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x44, 0x65, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x65, 0x73, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x1a, + 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x6f, + 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xda, - 0x01, 0x0a, 0x10, 0x53, 0x79, 0x73, 0x4e, 0x77, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, - 0x18, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x50, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x50, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x6f, 0x72, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x86, 0x02, 0x0a, 0x0e, - 0x43, 0x69, 0x6c, 0x69, 0x75, 0x6d, 0x53, 0x75, 0x6d, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, - 0x0a, 0x06, 0x53, 0x72, 0x63, 0x50, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x53, 0x72, 0x63, 0x50, 0x6f, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x44, 0x65, 0x73, 0x74, 0x50, 0x6f, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x44, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x64, - 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x65, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x44, 0x65, 0x73, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x44, 0x65, 0x73, 0x74, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x44, 0x65, 0x73, 0x74, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x12, 0x12, 0x0a, 0x04, 0x50, 0x6f, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x50, 0x6f, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x2b, 0x0a, 0x0f, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x6f, 0x64, 0x4e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, - 0x65, 0x32, 0x9e, 0x01, 0x0a, 0x0d, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x12, 0x40, 0x0a, 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x19, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x2b, + 0x0a, 0x0f, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x07, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x32, 0x9e, 0x01, 0x0a, 0x0d, + 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x40, 0x0a, + 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x19, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x62, + 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x19, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x31, 0x2e, 0x6f, - 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, 0x6f, 0x64, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x12, 0x19, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x2e, 0x50, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x61, 0x63, 0x63, 0x75, 0x6b, 0x6e, 0x6f, 0x78, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2d, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2d, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, - 0x73, 0x72, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x31, 0x2f, - 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x79, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x76, 0x31, 0x2e, 0x6f, + 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x50, 0x6f, 0x64, + 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x49, 0x5a, 0x47, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x63, 0x63, 0x75, 0x6b, + 0x6e, 0x6f, 0x78, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x2d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2d, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -729,15 +761,16 @@ var file_v1_observability_observability_proto_depIdxs = []int32{ 3, // 3: v1.observability.Response.EgressConnection:type_name -> v1.observability.SysNwSummaryData 4, // 4: v1.observability.Response.IngressData:type_name -> v1.observability.CiliumSummData 4, // 5: v1.observability.Response.EgressData:type_name -> v1.observability.CiliumSummData - 0, // 6: v1.observability.Observability.Summary:input_type -> v1.observability.Request - 0, // 7: v1.observability.Observability.GetPodNames:input_type -> v1.observability.Request - 1, // 8: v1.observability.Observability.Summary:output_type -> v1.observability.Response - 5, // 9: v1.observability.Observability.GetPodNames:output_type -> v1.observability.PodNameResponse - 8, // [8:10] is the sub-list for method output_type - 6, // [6:8] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 3, // 6: v1.observability.Response.BindConnection:type_name -> v1.observability.SysNwSummaryData + 0, // 7: v1.observability.Observability.Summary:input_type -> v1.observability.Request + 0, // 8: v1.observability.Observability.GetPodNames:input_type -> v1.observability.Request + 1, // 9: v1.observability.Observability.Summary:output_type -> v1.observability.Response + 5, // 10: v1.observability.Observability.GetPodNames:output_type -> v1.observability.PodNameResponse + 9, // [9:11] is the sub-list for method output_type + 7, // [7:9] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_v1_observability_observability_proto_init() } diff --git a/src/protobuf/v1/observability/observability.proto b/src/protobuf/v1/observability/observability.proto index 22acffa4..0fc21e88 100644 --- a/src/protobuf/v1/observability/observability.proto +++ b/src/protobuf/v1/observability/observability.proto @@ -31,6 +31,7 @@ message Response{ repeated SysNwSummaryData EgressConnection = 9; repeated CiliumSummData IngressData = 10; repeated CiliumSummData EgressData = 11; + repeated SysNwSummaryData BindConnection = 12; } message SysProcFileSummaryData { @@ -50,6 +51,9 @@ message SysNwSummaryData { string Namespace = 6; string Count = 7; string UpdatedTime = 8; + string BindPort = 9; + string BindAddress = 10; + } message CiliumSummData { diff --git a/src/protobuf/v1/observability/observability_grpc.pb.go b/src/protobuf/v1/observability/observability_grpc.pb.go index 9759f4fd..b148d5ca 100644 --- a/src/protobuf/v1/observability/observability_grpc.pb.go +++ b/src/protobuf/v1/observability/observability_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.15.8 +// - protoc v3.19.6 // source: v1/observability/observability.proto package observability diff --git a/src/types/observability.go b/src/types/observability.go index 51772648..44a33a45 100644 --- a/src/types/observability.go +++ b/src/types/observability.go @@ -120,6 +120,8 @@ type SystemSummary struct { Count int32 `json:"Count,omitempty"` UpdatedTime int64 `json:"UpdatedTime,omitempty"` WorkspaceId int32 `json:"WorkspaceId,omitempty"` + BindPort string `json:"BindPort,omitempty"` + BindAddress string `json:"BindAddress,omitempty"` } type SysSummaryTimeCount struct { @@ -174,7 +176,7 @@ type SysObsProcFileData struct { } type SysObsNwData struct { - InOut string + NetType string Protocol string Command string PodSvcIP string @@ -183,6 +185,8 @@ type SysObsNwData struct { Labels string Count uint32 UpdatedTime string + BindPort string + BindAddress string } type NwObsIngressEgressData struct { @@ -207,3 +211,16 @@ type SysObsProcFileMapValue struct { Count uint32 UpdatedTime string } + +type BindPortConnectionData struct { + SysBind string + Protocol string + Command string + PodSvcIP string + BindPort string + BindAddress string + Namespace string + Labels string + Count uint32 + UpdatedTime string +}