diff --git a/api/grpc/mpi/v1/command.pb.go b/api/grpc/mpi/v1/command.pb.go index 663e07917..6059afe37 100644 --- a/api/grpc/mpi/v1/command.pb.go +++ b/api/grpc/mpi/v1/command.pb.go @@ -2315,13 +2315,9 @@ func (x *APIDetails) GetListen() string { type NGINXAppProtectRuntimeInfo struct { state protoimpl.MessageState `protogen:"open.v1"` // NGINX App Protect Release - Release string `protobuf:"bytes,1,opt,name=release,proto3" json:"release,omitempty"` - // Attack signature version - AttackSignatureVersion string `protobuf:"bytes,2,opt,name=attack_signature_version,json=attackSignatureVersion,proto3" json:"attack_signature_version,omitempty"` - // Threat campaign version - ThreatCampaignVersion string `protobuf:"bytes,3,opt,name=threat_campaign_version,json=threatCampaignVersion,proto3" json:"threat_campaign_version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Release string `protobuf:"bytes,1,opt,name=release,proto3" json:"release,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *NGINXAppProtectRuntimeInfo) Reset() { @@ -2361,20 +2357,6 @@ func (x *NGINXAppProtectRuntimeInfo) GetRelease() string { return "" } -func (x *NGINXAppProtectRuntimeInfo) GetAttackSignatureVersion() string { - if x != nil { - return x.AttackSignatureVersion - } - return "" -} - -func (x *NGINXAppProtectRuntimeInfo) GetThreatCampaignVersion() string { - if x != nil { - return x.ThreatCampaignVersion - } - return "" -} - // A set of actions that can be performed on an instance type InstanceAction struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2417,18 +2399,12 @@ type AgentConfig struct { state protoimpl.MessageState `protogen:"open.v1"` // Command server settings Command *CommandServer `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"` - // Metrics server settings - Metrics *MetricsServer `protobuf:"bytes,2,opt,name=metrics,proto3" json:"metrics,omitempty"` - // File server settings - File *FileServer `protobuf:"bytes,3,opt,name=file,proto3" json:"file,omitempty"` // A series of key/value pairs to add more data to the NGINX Agent instance - Labels []*structpb.Struct `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` + Labels []*structpb.Struct `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty"` // A list of features that the NGINX Agent has - Features []string `protobuf:"bytes,5,rep,name=features,proto3" json:"features,omitempty"` - // Message buffer size, maximum not acknowledged messages from the subscribe perspective - MessageBufferSize string `protobuf:"bytes,6,opt,name=message_buffer_size,json=messageBufferSize,proto3" json:"message_buffer_size,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Features []string `protobuf:"bytes,3,rep,name=features,proto3" json:"features,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AgentConfig) Reset() { @@ -2468,20 +2444,6 @@ func (x *AgentConfig) GetCommand() *CommandServer { return nil } -func (x *AgentConfig) GetMetrics() *MetricsServer { - if x != nil { - return x.Metrics - } - return nil -} - -func (x *AgentConfig) GetFile() *FileServer { - if x != nil { - return x.File - } - return nil -} - func (x *AgentConfig) GetLabels() []*structpb.Struct { if x != nil { return x.Labels @@ -2496,13 +2458,6 @@ func (x *AgentConfig) GetFeatures() []string { return nil } -func (x *AgentConfig) GetMessageBufferSize() string { - if x != nil { - return x.MessageBufferSize - } - return "" -} - // The command server settings, associated with messaging from an external source type CommandServer struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2567,80 +2522,6 @@ func (x *CommandServer) GetTls() *TLSSettings { return nil } -// The metrics settings associated with origins (sources) of the metrics and destinations (exporter) -type MetricsServer struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MetricsServer) Reset() { - *x = MetricsServer{} - mi := &file_mpi_v1_command_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MetricsServer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MetricsServer) ProtoMessage() {} - -func (x *MetricsServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[37] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MetricsServer.ProtoReflect.Descriptor instead. -func (*MetricsServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{37} -} - -// The file settings associated with file server for configurations -type FileServer struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FileServer) Reset() { - *x = FileServer{} - mi := &file_mpi_v1_command_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FileServer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileServer) ProtoMessage() {} - -func (x *FileServer) ProtoReflect() protoreflect.Message { - mi := &file_mpi_v1_command_proto_msgTypes[38] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileServer.ProtoReflect.Descriptor instead. -func (*FileServer) Descriptor() ([]byte, []int) { - return file_mpi_v1_command_proto_rawDescGZIP(), []int{38} -} - var File_mpi_v1_command_proto protoreflect.FileDescriptor const file_mpi_v1_command_proto_rawDesc = "" + @@ -2793,26 +2674,18 @@ const file_mpi_v1_command_proto_rawDesc = "" + "\n" + "APIDetails\x12\x1a\n" + "\blocation\x18\x01 \x01(\tR\blocation\x12\x16\n" + - "\x06listen\x18\x02 \x01(\tR\x06listen\"\xa8\x01\n" + + "\x06listen\x18\x02 \x01(\tR\x06listen\"6\n" + "\x1aNGINXAppProtectRuntimeInfo\x12\x18\n" + - "\arelease\x18\x01 \x01(\tR\arelease\x128\n" + - "\x18attack_signature_version\x18\x02 \x01(\tR\x16attackSignatureVersion\x126\n" + - "\x17threat_campaign_version\x18\x03 \x01(\tR\x15threatCampaignVersion\"\x10\n" + - "\x0eInstanceAction\"\x94\x02\n" + + "\arelease\x18\x01 \x01(\tR\arelease\"\x10\n" + + "\x0eInstanceAction\"\x8b\x01\n" + "\vAgentConfig\x12/\n" + "\acommand\x18\x01 \x01(\v2\x15.mpi.v1.CommandServerR\acommand\x12/\n" + - "\ametrics\x18\x02 \x01(\v2\x15.mpi.v1.MetricsServerR\ametrics\x12&\n" + - "\x04file\x18\x03 \x01(\v2\x12.mpi.v1.FileServerR\x04file\x12/\n" + - "\x06labels\x18\x04 \x03(\v2\x17.google.protobuf.StructR\x06labels\x12\x1a\n" + - "\bfeatures\x18\x05 \x03(\tR\bfeatures\x12.\n" + - "\x13message_buffer_size\x18\x06 \x01(\tR\x11messageBufferSize\"\x90\x01\n" + + "\x06labels\x18\x02 \x03(\v2\x17.google.protobuf.StructR\x06labels\x12\x1a\n" + + "\bfeatures\x18\x03 \x03(\tR\bfeatures\"\x90\x01\n" + "\rCommandServer\x12.\n" + "\x06server\x18\x01 \x01(\v2\x16.mpi.v1.ServerSettingsR\x06server\x12(\n" + "\x04auth\x18\x02 \x01(\v2\x14.mpi.v1.AuthSettingsR\x04auth\x12%\n" + - "\x03tls\x18\x03 \x01(\v2\x13.mpi.v1.TLSSettingsR\x03tls\"\x0f\n" + - "\rMetricsServer\"\f\n" + - "\n" + - "FileServer2\x87\x03\n" + + "\x03tls\x18\x03 \x01(\v2\x13.mpi.v1.TLSSettingsR\x03tls2\x87\x03\n" + "\x0eCommandService\x12W\n" + "\x10CreateConnection\x12\x1f.mpi.v1.CreateConnectionRequest\x1a .mpi.v1.CreateConnectionResponse\"\x00\x12f\n" + "\x15UpdateDataPlaneStatus\x12$.mpi.v1.UpdateDataPlaneStatusRequest\x1a%.mpi.v1.UpdateDataPlaneStatusResponse\"\x00\x12f\n" + @@ -2832,7 +2705,7 @@ func file_mpi_v1_command_proto_rawDescGZIP() []byte { } var file_mpi_v1_command_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_mpi_v1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 39) +var file_mpi_v1_command_proto_msgTypes = make([]protoimpl.MessageInfo, 37) var file_mpi_v1_command_proto_goTypes = []any{ (InstanceHealth_InstanceHealthStatus)(0), // 0: mpi.v1.InstanceHealth.InstanceHealthStatus (InstanceMeta_InstanceType)(0), // 1: mpi.v1.InstanceMeta.InstanceType @@ -2873,50 +2746,48 @@ var file_mpi_v1_command_proto_goTypes = []any{ (*InstanceAction)(nil), // 36: mpi.v1.InstanceAction (*AgentConfig)(nil), // 37: mpi.v1.AgentConfig (*CommandServer)(nil), // 38: mpi.v1.CommandServer - (*MetricsServer)(nil), // 39: mpi.v1.MetricsServer - (*FileServer)(nil), // 40: mpi.v1.FileServer - (*MessageMeta)(nil), // 41: mpi.v1.MessageMeta - (*CommandResponse)(nil), // 42: mpi.v1.CommandResponse - (*FileOverview)(nil), // 43: mpi.v1.FileOverview - (*structpb.Struct)(nil), // 44: google.protobuf.Struct - (*ServerSettings)(nil), // 45: mpi.v1.ServerSettings - (*AuthSettings)(nil), // 46: mpi.v1.AuthSettings - (*TLSSettings)(nil), // 47: mpi.v1.TLSSettings + (*MessageMeta)(nil), // 39: mpi.v1.MessageMeta + (*CommandResponse)(nil), // 40: mpi.v1.CommandResponse + (*FileOverview)(nil), // 41: mpi.v1.FileOverview + (*structpb.Struct)(nil), // 42: google.protobuf.Struct + (*ServerSettings)(nil), // 43: mpi.v1.ServerSettings + (*AuthSettings)(nil), // 44: mpi.v1.AuthSettings + (*TLSSettings)(nil), // 45: mpi.v1.TLSSettings } var file_mpi_v1_command_proto_depIdxs = []int32{ - 41, // 0: mpi.v1.CreateConnectionRequest.message_meta:type_name -> mpi.v1.MessageMeta + 39, // 0: mpi.v1.CreateConnectionRequest.message_meta:type_name -> mpi.v1.MessageMeta 3, // 1: mpi.v1.CreateConnectionRequest.resource:type_name -> mpi.v1.Resource 27, // 2: mpi.v1.Resource.instances:type_name -> mpi.v1.Instance 4, // 3: mpi.v1.Resource.host_info:type_name -> mpi.v1.HostInfo 6, // 4: mpi.v1.Resource.container_info:type_name -> mpi.v1.ContainerInfo 5, // 5: mpi.v1.HostInfo.release_info:type_name -> mpi.v1.ReleaseInfo 5, // 6: mpi.v1.ContainerInfo.release_info:type_name -> mpi.v1.ReleaseInfo - 42, // 7: mpi.v1.CreateConnectionResponse.response:type_name -> mpi.v1.CommandResponse + 40, // 7: mpi.v1.CreateConnectionResponse.response:type_name -> mpi.v1.CommandResponse 37, // 8: mpi.v1.CreateConnectionResponse.agent_config:type_name -> mpi.v1.AgentConfig - 41, // 9: mpi.v1.UpdateDataPlaneStatusRequest.message_meta:type_name -> mpi.v1.MessageMeta + 39, // 9: mpi.v1.UpdateDataPlaneStatusRequest.message_meta:type_name -> mpi.v1.MessageMeta 3, // 10: mpi.v1.UpdateDataPlaneStatusRequest.resource:type_name -> mpi.v1.Resource 0, // 11: mpi.v1.InstanceHealth.instance_health_status:type_name -> mpi.v1.InstanceHealth.InstanceHealthStatus - 41, // 12: mpi.v1.UpdateDataPlaneHealthRequest.message_meta:type_name -> mpi.v1.MessageMeta + 39, // 12: mpi.v1.UpdateDataPlaneHealthRequest.message_meta:type_name -> mpi.v1.MessageMeta 10, // 13: mpi.v1.UpdateDataPlaneHealthRequest.instance_healths:type_name -> mpi.v1.InstanceHealth - 41, // 14: mpi.v1.DataPlaneResponse.message_meta:type_name -> mpi.v1.MessageMeta - 42, // 15: mpi.v1.DataPlaneResponse.command_response:type_name -> mpi.v1.CommandResponse - 41, // 16: mpi.v1.ManagementPlaneRequest.message_meta:type_name -> mpi.v1.MessageMeta + 39, // 14: mpi.v1.DataPlaneResponse.message_meta:type_name -> mpi.v1.MessageMeta + 40, // 15: mpi.v1.DataPlaneResponse.command_response:type_name -> mpi.v1.CommandResponse + 39, // 16: mpi.v1.ManagementPlaneRequest.message_meta:type_name -> mpi.v1.MessageMeta 15, // 17: mpi.v1.ManagementPlaneRequest.status_request:type_name -> mpi.v1.StatusRequest 16, // 18: mpi.v1.ManagementPlaneRequest.health_request:type_name -> mpi.v1.HealthRequest 17, // 19: mpi.v1.ManagementPlaneRequest.config_apply_request:type_name -> mpi.v1.ConfigApplyRequest 18, // 20: mpi.v1.ManagementPlaneRequest.config_upload_request:type_name -> mpi.v1.ConfigUploadRequest 19, // 21: mpi.v1.ManagementPlaneRequest.action_request:type_name -> mpi.v1.APIActionRequest 26, // 22: mpi.v1.ManagementPlaneRequest.command_status_request:type_name -> mpi.v1.CommandStatusRequest - 43, // 23: mpi.v1.ConfigApplyRequest.overview:type_name -> mpi.v1.FileOverview - 43, // 24: mpi.v1.ConfigUploadRequest.overview:type_name -> mpi.v1.FileOverview + 41, // 23: mpi.v1.ConfigApplyRequest.overview:type_name -> mpi.v1.FileOverview + 41, // 24: mpi.v1.ConfigUploadRequest.overview:type_name -> mpi.v1.FileOverview 20, // 25: mpi.v1.APIActionRequest.nginx_plus_action:type_name -> mpi.v1.NGINXPlusAction 21, // 26: mpi.v1.NGINXPlusAction.update_http_upstream_servers:type_name -> mpi.v1.UpdateHTTPUpstreamServers 22, // 27: mpi.v1.NGINXPlusAction.get_http_upstream_servers:type_name -> mpi.v1.GetHTTPUpstreamServers 23, // 28: mpi.v1.NGINXPlusAction.update_stream_servers:type_name -> mpi.v1.UpdateStreamServers 24, // 29: mpi.v1.NGINXPlusAction.get_upstreams:type_name -> mpi.v1.GetUpstreams 25, // 30: mpi.v1.NGINXPlusAction.get_stream_upstreams:type_name -> mpi.v1.GetStreamUpstreams - 44, // 31: mpi.v1.UpdateHTTPUpstreamServers.servers:type_name -> google.protobuf.Struct - 44, // 32: mpi.v1.UpdateStreamServers.servers:type_name -> google.protobuf.Struct + 42, // 31: mpi.v1.UpdateHTTPUpstreamServers.servers:type_name -> google.protobuf.Struct + 42, // 32: mpi.v1.UpdateStreamServers.servers:type_name -> google.protobuf.Struct 28, // 33: mpi.v1.Instance.instance_meta:type_name -> mpi.v1.InstanceMeta 29, // 34: mpi.v1.Instance.instance_config:type_name -> mpi.v1.InstanceConfig 30, // 35: mpi.v1.Instance.instance_runtime:type_name -> mpi.v1.InstanceRuntime @@ -2931,25 +2802,23 @@ var file_mpi_v1_command_proto_depIdxs = []int32{ 34, // 44: mpi.v1.NGINXPlusRuntimeInfo.stub_status:type_name -> mpi.v1.APIDetails 34, // 45: mpi.v1.NGINXPlusRuntimeInfo.plus_api:type_name -> mpi.v1.APIDetails 38, // 46: mpi.v1.AgentConfig.command:type_name -> mpi.v1.CommandServer - 39, // 47: mpi.v1.AgentConfig.metrics:type_name -> mpi.v1.MetricsServer - 40, // 48: mpi.v1.AgentConfig.file:type_name -> mpi.v1.FileServer - 44, // 49: mpi.v1.AgentConfig.labels:type_name -> google.protobuf.Struct - 45, // 50: mpi.v1.CommandServer.server:type_name -> mpi.v1.ServerSettings - 46, // 51: mpi.v1.CommandServer.auth:type_name -> mpi.v1.AuthSettings - 47, // 52: mpi.v1.CommandServer.tls:type_name -> mpi.v1.TLSSettings - 2, // 53: mpi.v1.CommandService.CreateConnection:input_type -> mpi.v1.CreateConnectionRequest - 8, // 54: mpi.v1.CommandService.UpdateDataPlaneStatus:input_type -> mpi.v1.UpdateDataPlaneStatusRequest - 11, // 55: mpi.v1.CommandService.UpdateDataPlaneHealth:input_type -> mpi.v1.UpdateDataPlaneHealthRequest - 13, // 56: mpi.v1.CommandService.Subscribe:input_type -> mpi.v1.DataPlaneResponse - 7, // 57: mpi.v1.CommandService.CreateConnection:output_type -> mpi.v1.CreateConnectionResponse - 9, // 58: mpi.v1.CommandService.UpdateDataPlaneStatus:output_type -> mpi.v1.UpdateDataPlaneStatusResponse - 12, // 59: mpi.v1.CommandService.UpdateDataPlaneHealth:output_type -> mpi.v1.UpdateDataPlaneHealthResponse - 14, // 60: mpi.v1.CommandService.Subscribe:output_type -> mpi.v1.ManagementPlaneRequest - 57, // [57:61] is the sub-list for method output_type - 53, // [53:57] is the sub-list for method input_type - 53, // [53:53] is the sub-list for extension type_name - 53, // [53:53] is the sub-list for extension extendee - 0, // [0:53] is the sub-list for field type_name + 42, // 47: mpi.v1.AgentConfig.labels:type_name -> google.protobuf.Struct + 43, // 48: mpi.v1.CommandServer.server:type_name -> mpi.v1.ServerSettings + 44, // 49: mpi.v1.CommandServer.auth:type_name -> mpi.v1.AuthSettings + 45, // 50: mpi.v1.CommandServer.tls:type_name -> mpi.v1.TLSSettings + 2, // 51: mpi.v1.CommandService.CreateConnection:input_type -> mpi.v1.CreateConnectionRequest + 8, // 52: mpi.v1.CommandService.UpdateDataPlaneStatus:input_type -> mpi.v1.UpdateDataPlaneStatusRequest + 11, // 53: mpi.v1.CommandService.UpdateDataPlaneHealth:input_type -> mpi.v1.UpdateDataPlaneHealthRequest + 13, // 54: mpi.v1.CommandService.Subscribe:input_type -> mpi.v1.DataPlaneResponse + 7, // 55: mpi.v1.CommandService.CreateConnection:output_type -> mpi.v1.CreateConnectionResponse + 9, // 56: mpi.v1.CommandService.UpdateDataPlaneStatus:output_type -> mpi.v1.UpdateDataPlaneStatusResponse + 12, // 57: mpi.v1.CommandService.UpdateDataPlaneHealth:output_type -> mpi.v1.UpdateDataPlaneHealthResponse + 14, // 58: mpi.v1.CommandService.Subscribe:output_type -> mpi.v1.ManagementPlaneRequest + 55, // [55:59] is the sub-list for method output_type + 51, // [51:55] is the sub-list for method input_type + 51, // [51:51] is the sub-list for extension type_name + 51, // [51:51] is the sub-list for extension extendee + 0, // [0:51] is the sub-list for field type_name } func init() { file_mpi_v1_command_proto_init() } @@ -2995,7 +2864,7 @@ func file_mpi_v1_command_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_mpi_v1_command_proto_rawDesc), len(file_mpi_v1_command_proto_rawDesc)), NumEnums: 2, - NumMessages: 39, + NumMessages: 37, NumExtensions: 0, NumServices: 1, }, diff --git a/api/grpc/mpi/v1/command.pb.validate.go b/api/grpc/mpi/v1/command.pb.validate.go index 34825aa11..b0ab8d8da 100644 --- a/api/grpc/mpi/v1/command.pb.validate.go +++ b/api/grpc/mpi/v1/command.pb.validate.go @@ -4994,10 +4994,6 @@ func (m *NGINXAppProtectRuntimeInfo) validate(all bool) error { // no validation rules for Release - // no validation rules for AttackSignatureVersion - - // no validation rules for ThreatCampaignVersion - if len(errors) > 0 { return NGINXAppProtectRuntimeInfoMultiError(errors) } @@ -5229,64 +5225,6 @@ func (m *AgentConfig) validate(all bool) error { } } - if all { - switch v := interface{}(m.GetMetrics()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentConfigValidationError{ - field: "Metrics", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentConfigValidationError{ - field: "Metrics", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetMetrics()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentConfigValidationError{ - field: "Metrics", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if all { - switch v := interface{}(m.GetFile()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AgentConfigValidationError{ - field: "File", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AgentConfigValidationError{ - field: "File", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetFile()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AgentConfigValidationError{ - field: "File", - reason: "embedded message failed validation", - cause: err, - } - } - } - for idx, item := range m.GetLabels() { _, _ = idx, item @@ -5321,8 +5259,6 @@ func (m *AgentConfig) validate(all bool) error { } - // no validation rules for MessageBufferSize - if len(errors) > 0 { return AgentConfigMultiError(errors) } @@ -5586,202 +5522,3 @@ var _ interface { Cause() error ErrorName() string } = CommandServerValidationError{} - -// Validate checks the field values on MetricsServer with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *MetricsServer) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on MetricsServer with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in MetricsServerMultiError, or -// nil if none found. -func (m *MetricsServer) ValidateAll() error { - return m.validate(true) -} - -func (m *MetricsServer) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return MetricsServerMultiError(errors) - } - - return nil -} - -// MetricsServerMultiError is an error wrapping multiple validation errors -// returned by MetricsServer.ValidateAll() if the designated constraints -// aren't met. -type MetricsServerMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m MetricsServerMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m MetricsServerMultiError) AllErrors() []error { return m } - -// MetricsServerValidationError is the validation error returned by -// MetricsServer.Validate if the designated constraints aren't met. -type MetricsServerValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e MetricsServerValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e MetricsServerValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e MetricsServerValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e MetricsServerValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e MetricsServerValidationError) ErrorName() string { return "MetricsServerValidationError" } - -// Error satisfies the builtin error interface -func (e MetricsServerValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sMetricsServer.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = MetricsServerValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = MetricsServerValidationError{} - -// Validate checks the field values on FileServer with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *FileServer) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on FileServer with the rules defined in -// the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in FileServerMultiError, or -// nil if none found. -func (m *FileServer) ValidateAll() error { - return m.validate(true) -} - -func (m *FileServer) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if len(errors) > 0 { - return FileServerMultiError(errors) - } - - return nil -} - -// FileServerMultiError is an error wrapping multiple validation errors -// returned by FileServer.ValidateAll() if the designated constraints aren't met. -type FileServerMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m FileServerMultiError) Error() string { - msgs := make([]string, 0, len(m)) - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m FileServerMultiError) AllErrors() []error { return m } - -// FileServerValidationError is the validation error returned by -// FileServer.Validate if the designated constraints aren't met. -type FileServerValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e FileServerValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e FileServerValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e FileServerValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e FileServerValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e FileServerValidationError) ErrorName() string { return "FileServerValidationError" } - -// Error satisfies the builtin error interface -func (e FileServerValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sFileServer.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = FileServerValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = FileServerValidationError{} diff --git a/api/grpc/mpi/v1/command.proto b/api/grpc/mpi/v1/command.proto index 9dd23ca8c..1b6a323a7 100644 --- a/api/grpc/mpi/v1/command.proto +++ b/api/grpc/mpi/v1/command.proto @@ -358,10 +358,6 @@ message APIDetails { message NGINXAppProtectRuntimeInfo { // NGINX App Protect Release string release = 1; - // Attack signature version - string attack_signature_version = 2; - // Threat campaign version - string threat_campaign_version = 3; } // A set of actions that can be performed on an instance @@ -371,16 +367,10 @@ message InstanceAction {} message AgentConfig { // Command server settings CommandServer command = 1; - // Metrics server settings - MetricsServer metrics = 2; - // File server settings - FileServer file = 3; // A series of key/value pairs to add more data to the NGINX Agent instance - repeated google.protobuf.Struct labels = 4; + repeated google.protobuf.Struct labels = 2; // A list of features that the NGINX Agent has - repeated string features = 5; - // Message buffer size, maximum not acknowledged messages from the subscribe perspective - string message_buffer_size = 6; + repeated string features = 3; } // The command server settings, associated with messaging from an external source @@ -392,9 +382,3 @@ message CommandServer { // TLS configuration for secure communication mpi.v1.TLSSettings tls = 3; } - -// The metrics settings associated with origins (sources) of the metrics and destinations (exporter) -message MetricsServer {} - -// The file settings associated with file server for configurations -message FileServer {} diff --git a/docs/proto/protos.md b/docs/proto/protos.md index 2d1bdf623..2f4ad07b1 100644 --- a/docs/proto/protos.md +++ b/docs/proto/protos.md @@ -53,7 +53,6 @@ - [CreateConnectionRequest](#mpi-v1-CreateConnectionRequest) - [CreateConnectionResponse](#mpi-v1-CreateConnectionResponse) - [DataPlaneResponse](#mpi-v1-DataPlaneResponse) - - [FileServer](#mpi-v1-FileServer) - [GetHTTPUpstreamServers](#mpi-v1-GetHTTPUpstreamServers) - [GetStreamUpstreams](#mpi-v1-GetStreamUpstreams) - [GetUpstreams](#mpi-v1-GetUpstreams) @@ -67,7 +66,6 @@ - [InstanceMeta](#mpi-v1-InstanceMeta) - [InstanceRuntime](#mpi-v1-InstanceRuntime) - [ManagementPlaneRequest](#mpi-v1-ManagementPlaneRequest) - - [MetricsServer](#mpi-v1-MetricsServer) - [NGINXAppProtectRuntimeInfo](#mpi-v1-NGINXAppProtectRuntimeInfo) - [NGINXPlusAction](#mpi-v1-NGINXPlusAction) - [NGINXPlusRuntimeInfo](#mpi-v1-NGINXPlusRuntimeInfo) @@ -709,11 +707,8 @@ This contains a series of NGINX Agent configurations | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | command | [CommandServer](#mpi-v1-CommandServer) | | Command server settings | -| metrics | [MetricsServer](#mpi-v1-MetricsServer) | | Metrics server settings | -| file | [FileServer](#mpi-v1-FileServer) | | File server settings | | labels | [google.protobuf.Struct](#google-protobuf-Struct) | repeated | A series of key/value pairs to add more data to the NGINX Agent instance | | features | [string](#string) | repeated | A list of features that the NGINX Agent has | -| message_buffer_size | [string](#string) | | Message buffer size, maximum not acknowledged messages from the subscribe perspective | @@ -843,16 +838,6 @@ Reports the status of an associated command. This may be in response to a Manage - - -### FileServer -The file settings associated with file server for configurations - - - - - - ### GetHTTPUpstreamServers @@ -1049,16 +1034,6 @@ A Management Plane request for information, triggers an associated rpc on the Da - - -### MetricsServer -The metrics settings associated with origins (sources) of the metrics and destinations (exporter) - - - - - - ### NGINXAppProtectRuntimeInfo @@ -1068,8 +1043,6 @@ A set of runtime NGINX App Protect settings | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | release | [string](#string) | | NGINX App Protect Release | -| attack_signature_version | [string](#string) | | Attack signature version | -| threat_campaign_version | [string](#string) | | Threat campaign version | diff --git a/internal/watcher/instance/instance_watcher_service.go b/internal/watcher/instance/instance_watcher_service.go index e163ee0c9..ce7c20174 100644 --- a/internal/watcher/instance/instance_watcher_service.go +++ b/internal/watcher/instance/instance_watcher_service.go @@ -304,12 +304,9 @@ func (iw *InstanceWatcherService) agentInstance(ctx context.Context) *mpi.Instan Actions: []*mpi.InstanceAction{}, Config: &mpi.InstanceConfig_AgentConfig{ AgentConfig: &mpi.AgentConfig{ - Command: config.ToCommandProto(iw.agentConfig.Command), - Metrics: &mpi.MetricsServer{}, - File: &mpi.FileServer{}, - Labels: labels, - Features: iw.agentConfig.Features, - MessageBufferSize: "", + Command: config.ToCommandProto(iw.agentConfig.Command), + Labels: labels, + Features: iw.agentConfig.Features, }, }, }, diff --git a/internal/watcher/instance/nginx_app_protect_process_parser.go b/internal/watcher/instance/nginx_app_protect_process_parser.go index 93001e86e..60f136801 100644 --- a/internal/watcher/instance/nginx_app_protect_process_parser.go +++ b/internal/watcher/instance/nginx_app_protect_process_parser.go @@ -18,19 +18,15 @@ import ( ) const ( - versionFilePath = "/opt/app_protect/VERSION" - releaseFilePath = "/opt/app_protect/RELEASE" - processName = "bd-socket-plugin" - attackSignatureVersionFilePath = "/opt/app_protect/var/update_files/signatures/version" - threatCampaignVersionFilePath = "/opt/app_protect/var/update_files/threat_campaigns/version" + versionFilePath = "/opt/app_protect/VERSION" + releaseFilePath = "/opt/app_protect/RELEASE" + processName = "bd-socket-plugin" ) type ( NginxAppProtectProcessParser struct { - versionFilePath string - releaseFilePath string - attackSignatureVersionFilePath string - threatCampaignVersionFilePath string + versionFilePath string + releaseFilePath string } ) @@ -38,10 +34,8 @@ var _ processParser = (*NginxAppProtectProcessParser)(nil) func NewNginxAppProtectProcessParser() *NginxAppProtectProcessParser { return &NginxAppProtectProcessParser{ - versionFilePath: versionFilePath, - releaseFilePath: releaseFilePath, - attackSignatureVersionFilePath: attackSignatureVersionFilePath, - threatCampaignVersionFilePath: threatCampaignVersionFilePath, + versionFilePath: versionFilePath, + releaseFilePath: releaseFilePath, } } @@ -73,9 +67,7 @@ func (n NginxAppProtectProcessParser) Parse( ConfigPath: "", Details: &mpi.InstanceRuntime_NginxAppProtectRuntimeInfo{ NginxAppProtectRuntimeInfo: &mpi.NGINXAppProtectRuntimeInfo{ - Release: n.release(ctx), - AttackSignatureVersion: n.attackSignatureVersion(ctx), - ThreatCampaignVersion: n.threatCampaignVersion(ctx), + Release: n.release(ctx), }, }, InstanceChildren: make([]*mpi.InstanceChild, 0), @@ -110,35 +102,3 @@ func (n NginxAppProtectProcessParser) release(ctx context.Context) string { return strings.TrimSuffix(string(release), "\n") } - -func (n NginxAppProtectProcessParser) attackSignatureVersion(ctx context.Context) string { - attackSignatureVersion, err := os.ReadFile(n.attackSignatureVersionFilePath) - if err != nil { - slog.WarnContext( - ctx, - "Unable to read NAP attack signature version file", - "file_path", n.attackSignatureVersionFilePath, - "error", err, - ) - - return "" - } - - return string(attackSignatureVersion) -} - -func (n NginxAppProtectProcessParser) threatCampaignVersion(ctx context.Context) string { - threatCampaignVersion, err := os.ReadFile(n.threatCampaignVersionFilePath) - if err != nil { - slog.WarnContext( - ctx, - "Unable to read NAP threat campaign version file", - "file_path", n.threatCampaignVersionFilePath, - "error", err, - ) - - return "" - } - - return string(threatCampaignVersion) -} diff --git a/internal/watcher/instance/nginx_app_protect_process_parser_test.go b/internal/watcher/instance/nginx_app_protect_process_parser_test.go index 56ba2d1f0..dc3f5166f 100644 --- a/internal/watcher/instance/nginx_app_protect_process_parser_test.go +++ b/internal/watcher/instance/nginx_app_protect_process_parser_test.go @@ -34,9 +34,7 @@ func TestNginxAppProtectProcessParser_Parse(t *testing.T) { BinaryPath: "/usr/share/ts/bin/bd-socket-plugin", Details: &mpi.InstanceRuntime_NginxAppProtectRuntimeInfo{ NginxAppProtectRuntimeInfo: &mpi.NGINXAppProtectRuntimeInfo{ - Release: "4.11.0", - AttackSignatureVersion: "2024.11.28", - ThreatCampaignVersion: "2024.12.02", + Release: "4.11.0", }, }, InstanceChildren: make([]*mpi.InstanceChild, 0), @@ -86,23 +84,9 @@ func TestNginxAppProtectProcessParser_Parse(t *testing.T) { _, err = releaseFile.WriteString("4.11.0") require.NoError(t, err) - attackSignatureVersionFile := helpers.CreateFileWithErrorCheck(t, os.TempDir(), "version") - defer helpers.RemoveFileWithErrorCheck(t, attackSignatureVersionFile.Name()) - - _, err = attackSignatureVersionFile.WriteString("2024.11.28") - require.NoError(t, err) - - threatCampaignVersionFile := helpers.CreateFileWithErrorCheck(t, os.TempDir(), "version") - defer helpers.RemoveFileWithErrorCheck(t, threatCampaignVersionFile.Name()) - - _, err = threatCampaignVersionFile.WriteString("2024.12.02") - require.NoError(t, err) - nginxAppProtectProcessParser := NewNginxAppProtectProcessParser() nginxAppProtectProcessParser.versionFilePath = versionFile.Name() nginxAppProtectProcessParser.releaseFilePath = releaseFile.Name() - nginxAppProtectProcessParser.attackSignatureVersionFilePath = attackSignatureVersionFile.Name() - nginxAppProtectProcessParser.threatCampaignVersionFilePath = threatCampaignVersionFile.Name() instances := nginxAppProtectProcessParser.Parse(ctx, processes) diff --git a/test/integration/grpc_management_plane_api_test.go b/test/integration/grpc_management_plane_api_test.go index 1d67a6292..2adf58523 100644 --- a/test/integration/grpc_management_plane_api_test.go +++ b/test/integration/grpc_management_plane_api_test.go @@ -606,8 +606,6 @@ func verifyConnection(t *testing.T, instancesLength int) string { instanceRuntimeInfo := instance.GetInstanceRuntime().GetNginxAppProtectRuntimeInfo() assert.NotEmpty(t, instanceRuntimeInfo.GetRelease()) - assert.NotEmpty(t, instanceRuntimeInfo.GetAttackSignatureVersion()) - assert.NotEmpty(t, instanceRuntimeInfo.GetThreatCampaignVersion()) case mpi.InstanceMeta_INSTANCE_TYPE_UNIT, mpi.InstanceMeta_INSTANCE_TYPE_UNSPECIFIED: fallthrough