From aa1d9c9b68f00cdeae1c839aa171b110077bb221 Mon Sep 17 00:00:00 2001 From: sanathkumarbs Date: Tue, 20 Sep 2022 21:11:06 -0700 Subject: [PATCH 1/2] feat: introducing security event definitions --- sdk/proto/events/event.pb.go | 4172 +++++++++++++++-- sdk/proto/events/event.proto | 86 + sdk/proto/ingest_svc.pb.go | 236 + sdk/proto/ingest_svc.proto | 16 + sdk/proto/metrics.svc.pb.go | 21 +- sdk/proto/metrics.svc.proto | 1 + src/plugins/events.go | 5 +- .../agent/sdk/v2/proto/events/event.pb.go | 4172 +++++++++++++++-- .../agent/sdk/v2/proto/events/event.proto | 86 + .../nginx/agent/sdk/v2/proto/ingest_svc.pb.go | 236 + .../nginx/agent/sdk/v2/proto/ingest_svc.proto | 16 + .../agent/sdk/v2/proto/metrics.svc.pb.go | 21 +- .../agent/sdk/v2/proto/metrics.svc.proto | 1 + .../nginx/agent/v2/src/plugins/events.go | 5 +- .../agent/sdk/v2/proto/events/event.pb.go | 4172 +++++++++++++++-- .../agent/sdk/v2/proto/events/event.proto | 86 + .../nginx/agent/sdk/v2/proto/ingest_svc.pb.go | 236 + .../nginx/agent/sdk/v2/proto/ingest_svc.proto | 16 + .../agent/sdk/v2/proto/metrics.svc.pb.go | 21 +- .../agent/sdk/v2/proto/metrics.svc.proto | 1 + 20 files changed, 12153 insertions(+), 1453 deletions(-) create mode 100644 sdk/proto/ingest_svc.pb.go create mode 100644 sdk/proto/ingest_svc.proto create mode 100644 test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go create mode 100644 test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto create mode 100644 vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go create mode 100644 vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto diff --git a/sdk/proto/events/event.pb.go b/sdk/proto/events/event.pb.go index 39b2e1760..00c7c1fb3 100644 --- a/sdk/proto/events/event.pb.go +++ b/sdk/proto/events/event.pb.go @@ -124,6 +124,7 @@ type Event struct { Metadata *Metadata `protobuf:"bytes,1,opt,name=Metadata,proto3" json:"metadata"` // Types that are valid to be assigned to Data: // *Event_ActivityEvent + // *Event_SecurityViolationEvent Data isEvent_Data `protobuf_oneof:"data"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -172,8 +173,12 @@ type isEvent_Data interface { type Event_ActivityEvent struct { ActivityEvent *ActivityEvent `protobuf:"bytes,2,opt,name=ActivityEvent,proto3,oneof" json:"activity_event"` } +type Event_SecurityViolationEvent struct { + SecurityViolationEvent *SecurityViolationEvent `protobuf:"bytes,3,opt,name=SecurityViolationEvent,proto3,oneof" json:"security_violation_event"` +} -func (*Event_ActivityEvent) isEvent_Data() {} +func (*Event_ActivityEvent) isEvent_Data() {} +func (*Event_SecurityViolationEvent) isEvent_Data() {} func (m *Event) GetData() isEvent_Data { if m != nil { @@ -196,10 +201,18 @@ func (m *Event) GetActivityEvent() *ActivityEvent { return nil } +func (m *Event) GetSecurityViolationEvent() *SecurityViolationEvent { + if x, ok := m.GetData().(*Event_SecurityViolationEvent); ok { + return x.SecurityViolationEvent + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*Event) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Event_ActivityEvent)(nil), + (*Event_SecurityViolationEvent)(nil), } } @@ -305,450 +318,3591 @@ func (m *ActivityEvent) GetDimensions() []*common.Dimension { return nil } -func init() { - proto.RegisterType((*Metadata)(nil), "f5.nginx.agent.sdk.events.Metadata") - proto.RegisterType((*Event)(nil), "f5.nginx.agent.sdk.events.Event") - proto.RegisterType((*EventReport)(nil), "f5.nginx.agent.sdk.events.EventReport") - proto.RegisterType((*ActivityEvent)(nil), "f5.nginx.agent.sdk.events.ActivityEvent") +// SecurityViolationEvent represents a Security Violation that is emitted by the Agent +type SecurityViolationEvent struct { + DateTime string `protobuf:"bytes,1,opt,name=DateTime,proto3" json:"date_time"` + PolicyName string `protobuf:"bytes,2,opt,name=PolicyName,proto3" json:"policy_name"` + SupportID string `protobuf:"bytes,3,opt,name=SupportID,proto3" json:"support_id"` + Outcome string `protobuf:"bytes,4,opt,name=Outcome,proto3" json:"outcome"` + OutcomeReason string `protobuf:"bytes,5,opt,name=OutcomeReason,proto3" json:"outcome_reason"` + BlockingExceptionReason string `protobuf:"bytes,6,opt,name=BlockingExceptionReason,proto3" json:"blocking_exception_reason"` + Method string `protobuf:"bytes,7,opt,name=Method,proto3" json:"method"` + Protocol string `protobuf:"bytes,8,opt,name=Protocol,proto3" json:"protocol"` + XForwardedForHeaderValue string `protobuf:"bytes,9,opt,name=XForwardedForHeaderValue,proto3" json:"xff_header_value"` + URI string `protobuf:"bytes,10,opt,name=URI,proto3" json:"uri"` + Request string `protobuf:"bytes,11,opt,name=Request,proto3" json:"request"` + IsTruncated string `protobuf:"bytes,12,opt,name=IsTruncated,proto3" json:"is_truncated"` + RequestStatus string `protobuf:"bytes,13,opt,name=RequestStatus,proto3" json:"request_status"` + ResponseCode string `protobuf:"bytes,14,opt,name=ResponseCode,proto3" json:"response_code"` + GeoIP string `protobuf:"bytes,15,opt,name=GeoIP,proto3" json:"geo_ip"` + Host string `protobuf:"bytes,16,opt,name=Host,proto3" json:"host"` + UnitHostname string `protobuf:"bytes,17,opt,name=UnitHostname,proto3" json:"unit_hostname"` + SourceHost string `protobuf:"bytes,18,opt,name=SourceHost,proto3" json:"source_host"` + VSName string `protobuf:"bytes,19,opt,name=VSName,proto3" json:"vs_name"` + IPClient string `protobuf:"bytes,20,opt,name=IPClient,proto3" json:"ip_client"` + DestinationPort string `protobuf:"bytes,21,opt,name=DestinationPort,proto3" json:"destination_port"` + SourcePort string `protobuf:"bytes,22,opt,name=SourcePort,proto3" json:"source_port"` + Violations string `protobuf:"bytes,23,opt,name=Violations,proto3" json:"violations"` + SubViolations string `protobuf:"bytes,24,opt,name=SubViolations,proto3" json:"sub_violations"` + ViolationRating string `protobuf:"bytes,25,opt,name=ViolationRating,proto3" json:"violation_rating"` + SigID string `protobuf:"bytes,26,opt,name=SigID,proto3" json:"sig_id"` + SigNames string `protobuf:"bytes,27,opt,name=SigNames,proto3" json:"sig_names"` + SigSetNames string `protobuf:"bytes,28,opt,name=SigSetNames,proto3" json:"sig_set_names"` + SigCVEs string `protobuf:"bytes,29,opt,name=SigCVEs,proto3" json:"sig_cves"` + ClientClass string `protobuf:"bytes,30,opt,name=ClientClass,proto3" json:"client_class"` + ClientApplication string `protobuf:"bytes,31,opt,name=ClientApplication,proto3" json:"client_application"` + ClientApplicationVersion string `protobuf:"bytes,32,opt,name=ClientApplicationVersion,proto3" json:"client_application_version"` + Severity string `protobuf:"bytes,33,opt,name=Severity,proto3" json:"severity"` + // NOTE: Severity Label might be deprecated if we have no use for it + SeverityLabel string `protobuf:"bytes,34,opt,name=SeverityLabel,proto3" json:"severity_label"` + Priority string `protobuf:"bytes,35,opt,name=Priority,proto3" json:"priority"` + ThreatCampaignNames string `protobuf:"bytes,36,opt,name=ThreatCampaignNames,proto3" json:"threat_campaign_names"` + BotAnomalies string `protobuf:"bytes,37,opt,name=BotAnomalies,proto3" json:"bot_anomalies"` + BotCategory string `protobuf:"bytes,38,opt,name=BotCategory,proto3" json:"bot_category"` + EnforcedBotAnomalies string `protobuf:"bytes,39,opt,name=EnforcedBotAnomalies,proto3" json:"enforced_bot_anomalies"` + BotSignatureName string `protobuf:"bytes,40,opt,name=BotSignatureName,proto3" json:"bot_signature_name"` + ViolationContexts string `protobuf:"bytes,41,opt,name=ViolationContexts,proto3" json:"violation_contexts"` + ViolationsData []*ViolationData `protobuf:"bytes,42,rep,name=ViolationsData,proto3" json:"violations_data"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } - -var fileDescriptor_2d17a9d3f0ddf27e = []byte{ - // 512 bytes of a gzipped FileDescriptorProto -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, 0x7a, 0x6a, 0xba, 0xd0, 0xa1, - 0x5b, 0x9e, 0x36, 0xfd, 0x02, 0x06, 0x0a, 0x94, 0xc5, 0x22, 0x91, 0x64, 0x09, 0x3a, 0x2e, 0x53, - 0x53, 0x9b, 0x9c, 0xcd, 0x8c, 0xf9, 0xe4, 0x91, 0x53, 0x95, 0x11, 0x4e, 0x8d, 0x52, 0x68, 0xb5, - 0x77, 0xfa, 0x43, 0xfb, 0x2b, 0x03, 0x79, 0x05, 0xbd, 0x15, 0x4b, 0x53, 0xd7, 0xaf, 0x87, 0xcd, - 0x28, 0x72, 0xab, 0x17, 0x2a, 0x89, 0xd6, 0x35, 0xb2, 0x06, 0x58, 0xf2, 0x90, 0x45, 0x29, 0x17, - 0x51, 0x6a, 0x76, 0xf0, 0x0a, 0x2f, 0xff, 0x75, 0x85, 0x6a, 0xaa, 0x1b, 0x78, 0x71, 0x51, 0xe4, - 0x16, 0x78, 0xcd, 0x5e, 0x7a, 0xcf, 0x67, 0x41, 0xef, 0x8e, 0x63, 0xed, 0xd7, 0x71, 0xac, 0xfd, - 0x3e, 0x8e, 0xb5, 0xaf, 0x4b, 0x9f, 0xcb, 0x6f, 0xd9, 0xb6, 0xb4, 0x70, 0xd0, 0xd6, 0x41, 0x5b, - 0x27, 0xf5, 0x6e, 0x9d, 0xfd, 0x5c, 0xfd, 0x50, 0x8e, 0x0a, 0xf4, 0xee, 0xc1, 0xf0, 0x5b, 0x1d, - 0xb9, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x99, 0xea, 0x62, 0xfe, 0xbc, 0x03, 0x00, 0x00, +func (m *SecurityViolationEvent) Reset() { *m = SecurityViolationEvent{} } +func (m *SecurityViolationEvent) String() string { return proto.CompactTextString(m) } +func (*SecurityViolationEvent) ProtoMessage() {} +func (*SecurityViolationEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{4} } - -func (m *Metadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SecurityViolationEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SecurityViolationEvent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil } - -func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityViolationEvent.Merge(m, src) +} +func (m *SecurityViolationEvent) XXX_Size() int { + return m.Size() +} +func (m *SecurityViolationEvent) XXX_DiscardUnknown() { + xxx_messageInfo_SecurityViolationEvent.DiscardUnknown(m) } -func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Category) > 0 { - i -= len(m.Category) - copy(dAtA[i:], m.Category) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Category))) - i-- - dAtA[i] = 0x3a - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x32 +var xxx_messageInfo_SecurityViolationEvent proto.InternalMessageInfo + +func (m *SecurityViolationEvent) GetDateTime() string { + if m != nil { + return m.DateTime } - if len(m.EventLevel) > 0 { - i -= len(m.EventLevel) - copy(dAtA[i:], m.EventLevel) - i = encodeVarintEvent(dAtA, i, uint64(len(m.EventLevel))) - i-- - dAtA[i] = 0x2a + return "" +} + +func (m *SecurityViolationEvent) GetPolicyName() string { + if m != nil { + return m.PolicyName } - if m.Timestamp != nil { - { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 + return "" +} + +func (m *SecurityViolationEvent) GetSupportID() string { + if m != nil { + return m.SupportID } - if len(m.CorrelationID) > 0 { - i -= len(m.CorrelationID) - copy(dAtA[i:], m.CorrelationID) - i = encodeVarintEvent(dAtA, i, uint64(len(m.CorrelationID))) - i-- - dAtA[i] = 0x1a + return "" +} + +func (m *SecurityViolationEvent) GetOutcome() string { + if m != nil { + return m.Outcome } - if len(m.UUID) > 0 { - i -= len(m.UUID) - copy(dAtA[i:], m.UUID) - i = encodeVarintEvent(dAtA, i, uint64(len(m.UUID))) - i-- - dAtA[i] = 0x12 + return "" +} + +func (m *SecurityViolationEvent) GetOutcomeReason() string { + if m != nil { + return m.OutcomeReason } - if len(m.Module) > 0 { - i -= len(m.Module) - copy(dAtA[i:], m.Module) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Module))) - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetBlockingExceptionReason() string { + if m != nil { + return m.BlockingExceptionReason } - return len(dAtA) - i, nil + return "" } -func (m *Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) GetMethod() string { + if m != nil { + return m.Method } - return dAtA[:n], nil + return "" } -func (m *Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" } -func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) +func (m *SecurityViolationEvent) GetXForwardedForHeaderValue() string { + if m != nil { + return m.XForwardedForHeaderValue } - if m.Data != nil { - { - size := m.Data.Size() - i -= size - if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + return "" +} + +func (m *SecurityViolationEvent) GetURI() string { + if m != nil { + return m.URI } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetRequest() string { + if m != nil { + return m.Request } - return len(dAtA) - i, nil + return "" } -func (m *Event_ActivityEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetIsTruncated() string { + if m != nil { + return m.IsTruncated + } + return "" } -func (m *Event_ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ActivityEvent != nil { - { - size, err := m.ActivityEvent.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (m *SecurityViolationEvent) GetRequestStatus() string { + if m != nil { + return m.RequestStatus } - return len(dAtA) - i, nil + return "" } -func (m *EventReport) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + +func (m *SecurityViolationEvent) GetResponseCode() string { + if m != nil { + return m.ResponseCode } - return dAtA[:n], nil + return "" } -func (m *EventReport) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetGeoIP() string { + if m != nil { + return m.GeoIP + } + return "" } -func (m *EventReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) +func (m *SecurityViolationEvent) GetHost() string { + if m != nil { + return m.Host } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + return "" +} + +func (m *SecurityViolationEvent) GetUnitHostname() string { + if m != nil { + return m.UnitHostname } - return len(dAtA) - i, nil + return "" } -func (m *ActivityEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) GetSourceHost() string { + if m != nil { + return m.SourceHost } - return dAtA[:n], nil + return "" } -func (m *ActivityEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetVSName() string { + if m != nil { + return m.VSName + } + return "" } -func (m *ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Dimensions) > 0 { - for iNdEx := len(m.Dimensions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Dimensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } +func (m *SecurityViolationEvent) GetIPClient() string { + if m != nil { + return m.IPClient } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetDestinationPort() string { + if m != nil { + return m.DestinationPort } - return len(dAtA) - i, nil + return "" } -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *SecurityViolationEvent) GetSourcePort() string { + if m != nil { + return m.SourcePort } - dAtA[offset] = uint8(v) - return base + return "" } -func (m *Metadata) Size() (n int) { - if m == nil { - return 0 + +func (m *SecurityViolationEvent) GetViolations() string { + if m != nil { + return m.Violations } - var l int - _ = l - l = len(m.Module) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSubViolations() string { + if m != nil { + return m.SubViolations } - l = len(m.UUID) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetViolationRating() string { + if m != nil { + return m.ViolationRating } - l = len(m.CorrelationID) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigID() string { + if m != nil { + return m.SigID } - if m.Timestamp != nil { - l = m.Timestamp.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigNames() string { + if m != nil { + return m.SigNames } - l = len(m.EventLevel) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigSetNames() string { + if m != nil { + return m.SigSetNames } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigCVEs() string { + if m != nil { + return m.SigCVEs } - l = len(m.Category) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetClientClass() string { + if m != nil { + return m.ClientClass } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetClientApplication() string { + if m != nil { + return m.ClientApplication } - return n + return "" } -func (m *Event) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetClientApplicationVersion() string { + if m != nil { + return m.ClientApplicationVersion } - var l int - _ = l - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSeverity() string { + if m != nil { + return m.Severity } - if m.Data != nil { - n += m.Data.Size() + return "" +} + +func (m *SecurityViolationEvent) GetSeverityLabel() string { + if m != nil { + return m.SeverityLabel } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetPriority() string { + if m != nil { + return m.Priority } - return n + return "" } -func (m *Event_ActivityEvent) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetThreatCampaignNames() string { + if m != nil { + return m.ThreatCampaignNames } - var l int - _ = l - if m.ActivityEvent != nil { - l = m.ActivityEvent.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetBotAnomalies() string { + if m != nil { + return m.BotAnomalies } - return n + return "" } -func (m *EventReport) Size() (n int) { - if m == nil { - return 0 + +func (m *SecurityViolationEvent) GetBotCategory() string { + if m != nil { + return m.BotCategory } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovEvent(uint64(l)) - } + return "" +} + +func (m *SecurityViolationEvent) GetEnforcedBotAnomalies() string { + if m != nil { + return m.EnforcedBotAnomalies } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetBotSignatureName() string { + if m != nil { + return m.BotSignatureName } - return n + return "" } -func (m *ActivityEvent) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetViolationContexts() string { + if m != nil { + return m.ViolationContexts } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetViolationsData() []*ViolationData { + if m != nil { + return m.ViolationsData } - if len(m.Dimensions) > 0 { - for _, e := range m.Dimensions { - l = e.Size() - n += 1 + l + sovEvent(uint64(l)) + return nil +} + +type SignatureData struct { + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"sig_data_id"` + Buffer string `protobuf:"bytes,2,opt,name=Buffer,proto3" json:"sig_data_buffer"` + Offset string `protobuf:"bytes,3,opt,name=Offset,proto3" json:"sig_data_offset"` + Length string `protobuf:"bytes,4,opt,name=Length,proto3" json:"sig_data_length"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignatureData) Reset() { *m = SignatureData{} } +func (m *SignatureData) String() string { return proto.CompactTextString(m) } +func (*SignatureData) ProtoMessage() {} +func (*SignatureData) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{5} +} +func (m *SignatureData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignatureData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +} +func (m *SignatureData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignatureData.Merge(m, src) +} +func (m *SignatureData) XXX_Size() int { + return m.Size() +} +func (m *SignatureData) XXX_DiscardUnknown() { + xxx_messageInfo_SignatureData.DiscardUnknown(m) +} + +var xxx_messageInfo_SignatureData proto.InternalMessageInfo + +func (m *SignatureData) GetID() string { + if m != nil { + return m.ID } - return n + return "" } -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *SignatureData) GetBuffer() string { + if m != nil { + return m.Buffer + } + return "" } -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *SignatureData) GetOffset() string { + if m != nil { + return m.Offset + } + return "" } -func (m *Metadata) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + +func (m *SignatureData) GetLength() string { + if m != nil { + return m.Length + } + return "" +} + +type ViolationData struct { + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"violation_data_name"` + Context string `protobuf:"bytes,2,opt,name=Context,proto3" json:"violation_data_context"` + ParameterName string `protobuf:"bytes,3,opt,name=ParameterName,proto3" json:"violation_data_param_name"` + ParamaterValue string `protobuf:"bytes,4,opt,name=ParamaterValue,proto3" json:"violation_data_param_value"` + Signatures []*SignatureData `protobuf:"bytes,5,rep,name=Signatures,proto3" json:"violation_data_signatures"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ViolationData) Reset() { *m = ViolationData{} } +func (m *ViolationData) String() string { return proto.CompactTextString(m) } +func (*ViolationData) ProtoMessage() {} +func (*ViolationData) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{6} +} +func (m *ViolationData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ViolationData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ViolationData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - if fieldNum <= 0 { - return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + return b[:n], nil + } +} +func (m *ViolationData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ViolationData.Merge(m, src) +} +func (m *ViolationData) XXX_Size() int { + return m.Size() +} +func (m *ViolationData) XXX_DiscardUnknown() { + xxx_messageInfo_ViolationData.DiscardUnknown(m) +} + +var xxx_messageInfo_ViolationData proto.InternalMessageInfo + +func (m *ViolationData) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ViolationData) GetContext() string { + if m != nil { + return m.Context + } + return "" +} + +func (m *ViolationData) GetParameterName() string { + if m != nil { + return m.ParameterName + } + return "" +} + +func (m *ViolationData) GetParamaterValue() string { + if m != nil { + return m.ParamaterValue + } + return "" +} + +func (m *ViolationData) GetSignatures() []*SignatureData { + if m != nil { + return m.Signatures + } + return nil +} + +func init() { + proto.RegisterType((*Metadata)(nil), "f5.nginx.agent.sdk.events.Metadata") + proto.RegisterType((*Event)(nil), "f5.nginx.agent.sdk.events.Event") + proto.RegisterType((*EventReport)(nil), "f5.nginx.agent.sdk.events.EventReport") + proto.RegisterType((*ActivityEvent)(nil), "f5.nginx.agent.sdk.events.ActivityEvent") + proto.RegisterType((*SecurityViolationEvent)(nil), "f5.nginx.agent.sdk.events.SecurityViolationEvent") + proto.RegisterType((*SignatureData)(nil), "f5.nginx.agent.sdk.events.SignatureData") + proto.RegisterType((*ViolationData)(nil), "f5.nginx.agent.sdk.events.ViolationData") +} + +func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } + +var fileDescriptor_2d17a9d3f0ddf27e = []byte{ + // 1620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x57, 0xdd, 0x6e, 0xdb, 0xc8, + 0x15, 0xae, 0x6c, 0xc7, 0x3f, 0xa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c, 0x87, 0x70, 0x71, + 0xe2, 0x81, 0xf2, 0x49, 0x91, 0x7b, 0xd8, 0x2a, 0x03, 0x87, 0xd2, 0xeb, 0x02, 0xfc, 0x13, 0x22, + 0xd7, 0x8c, 0xe7, 0x2c, 0xd5, 0x7f, 0x39, 0xc8, 0x11, 0x38, 0x3b, 0x2c, 0x72, 0xef, 0xe0, 0xba, + 0x33, 0x7f, 0x65, 0x58, 0xf4, 0x56, 0xbd, 0xde, 0x7a, 0x13, 0xb6, 0x62, 0xfa, 0xef, 0x0e, 0xf9, + 0x55, 0xed, 0xfa, 0xd6, 0x46, 0x2b, 0x14, 0x7a, 0xc4, 0xfe, 0x7e, 0x13, 0x4c, 0xd9, 0x9c, 0x74, + 0x6b, 0x3d, 0x62, 0x01, 0x7f, 0xae, 0x11, 0xda, 0x24, 0x9a, 0xcd, 0xca, 0x05, 0xc4, 0x78, 0x5e, + 0xdf, 0xac, 0xc6, 0x46, 0x2b, 0x14, 0xff, 0x19, 0xed, 0x9d, 0x5d, 0xa4, 0x2c, 0x50, 0xc3, 0x60, + 0xb1, 0x0c, 0x78, 0x9c, 0x98, 0x42, 0x7e, 0x01, 0xa2, 0xfd, 0x22, 0xf7, 0x3e, 0x53, 0x00, 0xfb, + 0xa1, 0xc5, 0x6d, 0x41, 0x6f, 0x52, 0xe9, 0x6d, 0x31, 0x10, 0xea, 0x45, 0x22, 0x16, 0xc1, 0x9c, + 0x33, 0x49, 0xbe, 0x74, 0xed, 0x30, 0x15, 0xca, 0x0f, 0x4a, 0x80, 0x36, 0x68, 0xba, 0xce, 0x03, + 0xa1, 0xaa, 0xe7, 0xde, 0x57, 0xae, 0xce, 0x5a, 0x55, 0x3d, 0xf9, 0xea, 0x24, 0xfc, 0x03, 0x7a, + 0xfc, 0x32, 0x99, 0x89, 0x34, 0x64, 0x51, 0x23, 0xe4, 0xaf, 0x41, 0x7c, 0x50, 0xe4, 0xde, 0x13, + 0x66, 0x71, 0xbf, 0x19, 0xfb, 0x46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0x6d, 0xaf, 0x01, 0xcd, + 0x72, 0x85, 0x6f, 0x0b, 0x44, 0x4b, 0x2a, 0x1e, 0xa2, 0xce, 0x69, 0x90, 0x06, 0x0b, 0xa6, 0x58, + 0x0a, 0xb1, 0xd6, 0xdd, 0xf3, 0xe8, 0x8a, 0x76, 0xa9, 0x79, 0x26, 0x62, 0x53, 0x83, 0x5f, 0xa1, + 0x5d, 0x30, 0x04, 0xaa, 0x7c, 0xbc, 0x6c, 0xb8, 0x65, 0x72, 0xa3, 0x17, 0xf3, 0x8c, 0xb9, 0xa2, + 0xc2, 0x31, 0x42, 0x55, 0xe9, 0x24, 0xb9, 0xf7, 0x7f, 0xdb, 0xa3, 0x51, 0xe7, 0x1b, 0xcf, 0x5c, + 0xf5, 0xb6, 0xa4, 0x35, 0xd7, 0x03, 0xfa, 0xf3, 0xa7, 0xc3, 0xd6, 0xc7, 0x4f, 0x87, 0xad, 0x7f, + 0x7f, 0x3a, 0x6c, 0xfd, 0x34, 0x8a, 0xb9, 0xba, 0xc8, 0xa6, 0xfa, 0x9d, 0xdd, 0x87, 0x48, 0x7d, + 0x88, 0xd4, 0x97, 0xd1, 0xfb, 0xfe, 0xea, 0xc4, 0xfc, 0x0f, 0xb8, 0x6f, 0x42, 0xfe, 0xf1, 0xd6, + 0xc3, 0x4c, 0x37, 0x81, 0xf7, 0xed, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, 0x39, 0xb9, 0x5d, + 0x6d, 0x0f, 0x00, 0x00, +} + +func (m *Metadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Category) > 0 { + i -= len(m.Category) + copy(dAtA[i:], m.Category) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Category))) + i-- + dAtA[i] = 0x3a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x32 + } + if len(m.EventLevel) > 0 { + i -= len(m.EventLevel) + copy(dAtA[i:], m.EventLevel) + i = encodeVarintEvent(dAtA, i, uint64(len(m.EventLevel))) + i-- + dAtA[i] = 0x2a + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) } - switch fieldNum { - case 1: + i-- + dAtA[i] = 0x22 + } + if len(m.CorrelationID) > 0 { + i -= len(m.CorrelationID) + copy(dAtA[i:], m.CorrelationID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.CorrelationID))) + i-- + dAtA[i] = 0x1a + } + if len(m.UUID) > 0 { + i -= len(m.UUID) + copy(dAtA[i:], m.UUID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.UUID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Event) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Event) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Data != nil { + { + size := m.Data.Size() + i -= size + if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Event_ActivityEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event_ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ActivityEvent != nil { + { + size, err := m.ActivityEvent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Event_SecurityViolationEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event_SecurityViolationEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SecurityViolationEvent != nil { + { + size, err := m.SecurityViolationEvent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *EventReport) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventReport) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ActivityEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ActivityEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Dimensions) > 0 { + for iNdEx := len(m.Dimensions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dimensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SecurityViolationEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SecurityViolationEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecurityViolationEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ViolationsData) > 0 { + for iNdEx := len(m.ViolationsData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ViolationsData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xd2 + } + } + if len(m.ViolationContexts) > 0 { + i -= len(m.ViolationContexts) + copy(dAtA[i:], m.ViolationContexts) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ViolationContexts))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xca + } + if len(m.BotSignatureName) > 0 { + i -= len(m.BotSignatureName) + copy(dAtA[i:], m.BotSignatureName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotSignatureName))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xc2 + } + if len(m.EnforcedBotAnomalies) > 0 { + i -= len(m.EnforcedBotAnomalies) + copy(dAtA[i:], m.EnforcedBotAnomalies) + i = encodeVarintEvent(dAtA, i, uint64(len(m.EnforcedBotAnomalies))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xba + } + if len(m.BotCategory) > 0 { + i -= len(m.BotCategory) + copy(dAtA[i:], m.BotCategory) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotCategory))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xb2 + } + if len(m.BotAnomalies) > 0 { + i -= len(m.BotAnomalies) + copy(dAtA[i:], m.BotAnomalies) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotAnomalies))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xaa + } + if len(m.ThreatCampaignNames) > 0 { + i -= len(m.ThreatCampaignNames) + copy(dAtA[i:], m.ThreatCampaignNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ThreatCampaignNames))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xa2 + } + if len(m.Priority) > 0 { + i -= len(m.Priority) + copy(dAtA[i:], m.Priority) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Priority))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x9a + } + if len(m.SeverityLabel) > 0 { + i -= len(m.SeverityLabel) + copy(dAtA[i:], m.SeverityLabel) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SeverityLabel))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 + } + if len(m.Severity) > 0 { + i -= len(m.Severity) + copy(dAtA[i:], m.Severity) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Severity))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x8a + } + if len(m.ClientApplicationVersion) > 0 { + i -= len(m.ClientApplicationVersion) + copy(dAtA[i:], m.ClientApplicationVersion) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientApplicationVersion))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + } + if len(m.ClientApplication) > 0 { + i -= len(m.ClientApplication) + copy(dAtA[i:], m.ClientApplication) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientApplication))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + if len(m.ClientClass) > 0 { + i -= len(m.ClientClass) + copy(dAtA[i:], m.ClientClass) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientClass))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + if len(m.SigCVEs) > 0 { + i -= len(m.SigCVEs) + copy(dAtA[i:], m.SigCVEs) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigCVEs))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xea + } + if len(m.SigSetNames) > 0 { + i -= len(m.SigSetNames) + copy(dAtA[i:], m.SigSetNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigSetNames))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe2 + } + if len(m.SigNames) > 0 { + i -= len(m.SigNames) + copy(dAtA[i:], m.SigNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigNames))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xda + } + if len(m.SigID) > 0 { + i -= len(m.SigID) + copy(dAtA[i:], m.SigID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigID))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + if len(m.ViolationRating) > 0 { + i -= len(m.ViolationRating) + copy(dAtA[i:], m.ViolationRating) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ViolationRating))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + if len(m.SubViolations) > 0 { + i -= len(m.SubViolations) + copy(dAtA[i:], m.SubViolations) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SubViolations))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(m.Violations) > 0 { + i -= len(m.Violations) + copy(dAtA[i:], m.Violations) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Violations))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.SourcePort) > 0 { + i -= len(m.SourcePort) + copy(dAtA[i:], m.SourcePort) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourcePort))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if len(m.DestinationPort) > 0 { + i -= len(m.DestinationPort) + copy(dAtA[i:], m.DestinationPort) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DestinationPort))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if len(m.IPClient) > 0 { + i -= len(m.IPClient) + copy(dAtA[i:], m.IPClient) + i = encodeVarintEvent(dAtA, i, uint64(len(m.IPClient))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if len(m.VSName) > 0 { + i -= len(m.VSName) + copy(dAtA[i:], m.VSName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.VSName))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if len(m.SourceHost) > 0 { + i -= len(m.SourceHost) + copy(dAtA[i:], m.SourceHost) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourceHost))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.UnitHostname) > 0 { + i -= len(m.UnitHostname) + copy(dAtA[i:], m.UnitHostname) + i = encodeVarintEvent(dAtA, i, uint64(len(m.UnitHostname))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.GeoIP) > 0 { + i -= len(m.GeoIP) + copy(dAtA[i:], m.GeoIP) + i = encodeVarintEvent(dAtA, i, uint64(len(m.GeoIP))) + i-- + dAtA[i] = 0x7a + } + if len(m.ResponseCode) > 0 { + i -= len(m.ResponseCode) + copy(dAtA[i:], m.ResponseCode) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ResponseCode))) + i-- + dAtA[i] = 0x72 + } + if len(m.RequestStatus) > 0 { + i -= len(m.RequestStatus) + copy(dAtA[i:], m.RequestStatus) + i = encodeVarintEvent(dAtA, i, uint64(len(m.RequestStatus))) + i-- + dAtA[i] = 0x6a + } + if len(m.IsTruncated) > 0 { + i -= len(m.IsTruncated) + copy(dAtA[i:], m.IsTruncated) + i = encodeVarintEvent(dAtA, i, uint64(len(m.IsTruncated))) + i-- + dAtA[i] = 0x62 + } + if len(m.Request) > 0 { + i -= len(m.Request) + copy(dAtA[i:], m.Request) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Request))) + i-- + dAtA[i] = 0x5a + } + if len(m.URI) > 0 { + i -= len(m.URI) + copy(dAtA[i:], m.URI) + i = encodeVarintEvent(dAtA, i, uint64(len(m.URI))) + i-- + dAtA[i] = 0x52 + } + if len(m.XForwardedForHeaderValue) > 0 { + i -= len(m.XForwardedForHeaderValue) + copy(dAtA[i:], m.XForwardedForHeaderValue) + i = encodeVarintEvent(dAtA, i, uint64(len(m.XForwardedForHeaderValue))) + i-- + dAtA[i] = 0x4a + } + if len(m.Protocol) > 0 { + i -= len(m.Protocol) + copy(dAtA[i:], m.Protocol) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Protocol))) + i-- + dAtA[i] = 0x42 + } + if len(m.Method) > 0 { + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x3a + } + if len(m.BlockingExceptionReason) > 0 { + i -= len(m.BlockingExceptionReason) + copy(dAtA[i:], m.BlockingExceptionReason) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BlockingExceptionReason))) + i-- + dAtA[i] = 0x32 + } + if len(m.OutcomeReason) > 0 { + i -= len(m.OutcomeReason) + copy(dAtA[i:], m.OutcomeReason) + i = encodeVarintEvent(dAtA, i, uint64(len(m.OutcomeReason))) + i-- + dAtA[i] = 0x2a + } + if len(m.Outcome) > 0 { + i -= len(m.Outcome) + copy(dAtA[i:], m.Outcome) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Outcome))) + i-- + dAtA[i] = 0x22 + } + if len(m.SupportID) > 0 { + i -= len(m.SupportID) + copy(dAtA[i:], m.SupportID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SupportID))) + i-- + dAtA[i] = 0x1a + } + if len(m.PolicyName) > 0 { + i -= len(m.PolicyName) + copy(dAtA[i:], m.PolicyName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.PolicyName))) + i-- + dAtA[i] = 0x12 + } + if len(m.DateTime) > 0 { + i -= len(m.DateTime) + copy(dAtA[i:], m.DateTime) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DateTime))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SignatureData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SignatureData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Length) > 0 { + i -= len(m.Length) + copy(dAtA[i:], m.Length) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Length))) + i-- + dAtA[i] = 0x22 + } + if len(m.Offset) > 0 { + i -= len(m.Offset) + copy(dAtA[i:], m.Offset) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Offset))) + i-- + dAtA[i] = 0x1a + } + if len(m.Buffer) > 0 { + i -= len(m.Buffer) + copy(dAtA[i:], m.Buffer) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Buffer))) + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ViolationData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ViolationData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ViolationData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.ParamaterValue) > 0 { + i -= len(m.ParamaterValue) + copy(dAtA[i:], m.ParamaterValue) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ParamaterValue))) + i-- + dAtA[i] = 0x22 + } + if len(m.ParameterName) > 0 { + i -= len(m.ParameterName) + copy(dAtA[i:], m.ParameterName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ParameterName))) + i-- + dAtA[i] = 0x1a + } + if len(m.Context) > 0 { + i -= len(m.Context) + copy(dAtA[i:], m.Context) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Context))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Module) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.UUID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.CorrelationID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.Timestamp != nil { + l = m.Timestamp.Size() + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.EventLevel) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Category) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Event) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.Data != nil { + n += m.Data.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Event_ActivityEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ActivityEvent != nil { + l = m.ActivityEvent.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} +func (m *Event_SecurityViolationEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SecurityViolationEvent != nil { + l = m.SecurityViolationEvent.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} +func (m *EventReport) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ActivityEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if len(m.Dimensions) > 0 { + for _, e := range m.Dimensions { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SecurityViolationEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DateTime) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.PolicyName) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.SupportID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Outcome) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.OutcomeReason) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.BlockingExceptionReason) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Method) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Protocol) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.XForwardedForHeaderValue) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.URI) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Request) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.IsTruncated) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.RequestStatus) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ResponseCode) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.GeoIP) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Host) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.UnitHostname) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SourceHost) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.VSName) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.IPClient) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.DestinationPort) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SourcePort) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Violations) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SubViolations) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ViolationRating) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigID) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigSetNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigCVEs) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientClass) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientApplication) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientApplicationVersion) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Severity) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SeverityLabel) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Priority) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ThreatCampaignNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotAnomalies) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotCategory) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.EnforcedBotAnomalies) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotSignatureName) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ViolationContexts) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + if len(m.ViolationsData) > 0 { + for _, e := range m.ViolationsData { + l = e.Size() + n += 2 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Buffer) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Offset) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Length) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ViolationData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Context) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ParameterName) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ParamaterValue) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if len(m.Signatures) > 0 { + for _, e := range m.Signatures { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Metadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UUID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UUID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorrelationID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CorrelationID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = &types.Timestamp{} + } + if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventLevel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventLevel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Category = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Event) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Event: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivityEvent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ActivityEvent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Event_ActivityEvent{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityViolationEvent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SecurityViolationEvent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Event_SecurityViolationEvent{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventReport) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventReport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventReport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, &Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ActivityEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ActivityEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ActivityEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dimensions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Dimensions = append(m.Dimensions, &common.Dimension{}) + if err := m.Dimensions[len(m.Dimensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SecurityViolationEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SecurityViolationEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SecurityViolationEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DateTime", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DateTime = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupportID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupportID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Outcome", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Outcome = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutcomeReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutcomeReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockingExceptionReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockingExceptionReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Protocol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field XForwardedForHeaderValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XForwardedForHeaderValue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Request = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IsTruncated", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IsTruncated = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseCode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResponseCode = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GeoIP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GeoIP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnitHostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UnitHostname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceHost", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceHost = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VSName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VSName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IPClient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IPClient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourcePort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Violations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Violations = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubViolations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubViolations = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ViolationRating", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ViolationRating = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 27: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigNames = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 28: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigSetNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigSetNames = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 29: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigCVEs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigCVEs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientClass", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientClass = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientApplication", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientApplication = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 32: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientApplicationVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientApplicationVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 33: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Severity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Severity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeverityLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SeverityLabel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 35: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Priority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 36: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ThreatCampaignNames", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -776,11 +3930,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Module = string(dAtA[iNdEx:postIndex]) + m.ThreatCampaignNames = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 37: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UUID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotAnomalies", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -808,11 +3962,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UUID = string(dAtA[iNdEx:postIndex]) + m.BotAnomalies = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 38: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CorrelationID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotCategory", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -840,13 +3994,13 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CorrelationID = string(dAtA[iNdEx:postIndex]) + m.BotCategory = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 39: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EnforcedBotAnomalies", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -856,31 +4010,27 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Timestamp == nil { - m.Timestamp = &types.Timestamp{} - } - if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EnforcedBotAnomalies = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 40: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EventLevel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotSignatureName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -908,11 +4058,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.EventLevel = string(dAtA[iNdEx:postIndex]) + m.BotSignatureName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 41: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ViolationContexts", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -940,13 +4090,13 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.ViolationContexts = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 42: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ViolationsData", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -956,23 +4106,25 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - m.Category = string(dAtA[iNdEx:postIndex]) + m.ViolationsData = append(m.ViolationsData, &ViolationData{}) + if err := m.ViolationsData[len(m.ViolationsData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -996,7 +4148,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *Event) Unmarshal(dAtA []byte) error { +func (m *SignatureData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1019,17 +4171,17 @@ func (m *Event) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Event: wiretype end group for non-group") + return fmt.Errorf("proto: SignatureData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignatureData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1039,33 +4191,61 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Metadata == nil { - m.Metadata = &Metadata{} + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.Buffer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActivityEvent", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1075,26 +4255,55 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - v := &ActivityEvent{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Offset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) } - m.Data = &Event_ActivityEvent{v} + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Length = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1118,7 +4327,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } return nil } -func (m *EventReport) Unmarshal(dAtA []byte) error { +func (m *ViolationData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1141,17 +4350,17 @@ func (m *EventReport) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventReport: wiretype end group for non-group") + return fmt.Errorf("proto: ViolationData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventReport: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ViolationData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1161,80 +4370,91 @@ func (m *EventReport) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, &Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActivityEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent + m.Context = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterName", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActivityEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActivityEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ParameterName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ParamaterValue", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1262,11 +4482,11 @@ func (m *ActivityEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Message = string(dAtA[iNdEx:postIndex]) + m.ParamaterValue = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dimensions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1293,8 +4513,8 @@ func (m *ActivityEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Dimensions = append(m.Dimensions, &common.Dimension{}) - if err := m.Dimensions[len(m.Dimensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Signatures = append(m.Signatures, &SignatureData{}) + if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/sdk/proto/events/event.proto b/sdk/proto/events/event.proto index a7e4f4c27..143cb259e 100644 --- a/sdk/proto/events/event.proto +++ b/sdk/proto/events/event.proto @@ -20,6 +20,19 @@ message Event { Metadata Metadata = 1 [(gogoproto.jsontag) = "metadata" ]; oneof data { ActivityEvent ActivityEvent = 2 [(gogoproto.jsontag) = "activity_event" ]; + + // While generating the SecurityViolationEvent, the Metadata for a SecurityViolationEvent + // would look as shown below: + // * Module = Agent + // * UUID = A UUID generated by the Agent for the EventReport + // * CorrelationID = The UUID will be used as the Correlation ID to track the EventReport + // * Timestamp = The timestamp when NGINX Agent received the violation event + // * EventLevel = All the SecurityViolationEvent would be generated at an ERROR_EVENT_LEVEL ("ERROR") level + // In future, the levels might be dynamically chosen based on Request Outcome of SecurityViolationEvent + // * Type = NGINX_EVENT_TYPE ("Nginx") + // * Category = APP_PROTECT_CATEGORY ("AppProtect") + // + SecurityViolationEvent SecurityViolationEvent = 3 [(gogoproto.jsontag) = "security_violation_event" ]; } } @@ -30,4 +43,77 @@ message EventReport { message ActivityEvent { string Message = 1 [(gogoproto.jsontag) = "message" ]; repeated f5.nginx.agent.sdk.common.Dimension Dimensions = 2 [(gogoproto.jsontag) = "dimensions" ]; +} + +// SecurityViolationEvent represents a Security Violation that is emitted by the Agent +message SecurityViolationEvent { + string DateTime = 1 [(gogoproto.jsontag) = "date_time" ]; + string PolicyName = 2 [(gogoproto.jsontag) = "policy_name" ]; + string SupportID = 3 [(gogoproto.jsontag) = "support_id" ]; + + string Outcome = 4 [(gogoproto.jsontag) = "outcome" ]; + string OutcomeReason = 5 [(gogoproto.jsontag) = "outcome_reason" ]; + string BlockingExceptionReason = 6 [(gogoproto.jsontag) = "blocking_exception_reason" ]; + + string Method = 7 [(gogoproto.jsontag) = "method" ]; + string Protocol = 8 [(gogoproto.jsontag) = "protocol" ]; + string XForwardedForHeaderValue = 9 [(gogoproto.jsontag) = "xff_header_value" ]; + + string URI = 10 [(gogoproto.jsontag) = "uri" ]; + string Request = 11 [(gogoproto.jsontag) = "request" ]; + string IsTruncated = 12 [(gogoproto.jsontag) = "is_truncated" ]; + string RequestStatus = 13 [(gogoproto.jsontag) = "request_status" ]; + string ResponseCode = 14 [(gogoproto.jsontag) = "response_code" ]; + + string GeoIP = 15 [(gogoproto.jsontag) = "geo_ip" ]; + string Host = 16 [(gogoproto.jsontag) = "host" ]; + string UnitHostname = 17 [(gogoproto.jsontag) = "unit_hostname" ]; + string SourceHost = 18 [(gogoproto.jsontag) = "source_host" ]; + string VSName = 19 [(gogoproto.jsontag) = "vs_name" ]; + string IPClient = 20 [(gogoproto.jsontag) = "ip_client" ]; + string DestinationPort = 21 [(gogoproto.jsontag) = "destination_port" ]; + string SourcePort = 22 [(gogoproto.jsontag) = "source_port" ]; + + string Violations = 23 [(gogoproto.jsontag) = "violations" ]; + string SubViolations = 24 [(gogoproto.jsontag) = "sub_violations" ]; + string ViolationRating = 25 [(gogoproto.jsontag) = "violation_rating" ]; + + string SigID = 26 [(gogoproto.jsontag) = "sig_id" ]; + string SigNames = 27 [(gogoproto.jsontag) = "sig_names" ]; + string SigSetNames = 28 [(gogoproto.jsontag) = "sig_set_names" ]; + string SigCVEs = 29 [(gogoproto.jsontag) = "sig_cves" ]; + + string ClientClass = 30 [(gogoproto.jsontag) = "client_class" ]; + string ClientApplication = 31 [(gogoproto.jsontag) = "client_application" ]; + string ClientApplicationVersion = 32 [(gogoproto.jsontag) = "client_application_version" ]; + + string Severity = 33 [(gogoproto.jsontag) = "severity" ]; + // NOTE: Severity Label might be deprecated if we have no use for it + string SeverityLabel = 34 [(gogoproto.jsontag) = "severity_label" ]; + string Priority = 35 [(gogoproto.jsontag) = "priority" ]; + + string ThreatCampaignNames = 36 [(gogoproto.jsontag) = "threat_campaign_names" ]; + + string BotAnomalies = 37 [(gogoproto.jsontag) = "bot_anomalies" ]; + string BotCategory = 38 [(gogoproto.jsontag) = "bot_category" ]; + string EnforcedBotAnomalies = 39 [(gogoproto.jsontag) = "enforced_bot_anomalies" ]; + string BotSignatureName = 40 [(gogoproto.jsontag) = "bot_signature_name" ]; + + string ViolationContexts = 41 [(gogoproto.jsontag) = "violation_contexts" ]; + repeated ViolationData ViolationsData = 42 [(gogoproto.jsontag) = "violations_data" ]; +} + +message SignatureData { + string ID = 1 [(gogoproto.jsontag) = "sig_data_id" ]; + string Buffer = 2 [(gogoproto.jsontag) = "sig_data_buffer" ]; + string Offset = 3 [(gogoproto.jsontag) = "sig_data_offset" ]; + string Length = 4 [(gogoproto.jsontag) = "sig_data_length" ]; +} + +message ViolationData { + string Name = 1 [(gogoproto.jsontag) = "violation_data_name" ]; + string Context = 2 [(gogoproto.jsontag) = "violation_data_context" ]; + string ParameterName = 3 [(gogoproto.jsontag) = "violation_data_param_name" ]; + string ParamaterValue = 4 [(gogoproto.jsontag) = "violation_data_param_value" ]; + repeated SignatureData Signatures = 5 [(gogoproto.jsontag) = "violation_data_signatures" ]; } \ No newline at end of file diff --git a/sdk/proto/ingest_svc.pb.go b/sdk/proto/ingest_svc.pb.go new file mode 100644 index 000000000..654309820 --- /dev/null +++ b/sdk/proto/ingest_svc.pb.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ingest_svc.proto + +package proto + +import ( + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + events "github.com/nginx/agent/sdk/v2/proto/events" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("ingest_svc.proto", fileDescriptor_e87a1d7991134362) } + +var fileDescriptor_e87a1d7991134362 = []byte{ + // 232 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0xcc, 0x4b, 0x4f, + 0x2d, 0x2e, 0x89, 0x2f, 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4a, 0x33, + 0xd5, 0xcb, 0x4b, 0xcf, 0xcc, 0xab, 0xd0, 0x4b, 0x4c, 0x4f, 0xcd, 0x2b, 0xd1, 0x2b, 0x4e, 0xc9, + 0x96, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xab, 0x48, 0x2a, 0x4d, 0xd3, 0x4f, + 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0xcd, 0x4d, 0x2d, 0x29, 0xca, 0x4c, 0x2e, 0x86, + 0x72, 0x85, 0x52, 0xcb, 0x52, 0xf3, 0x4a, 0x8a, 0xf5, 0xc1, 0x14, 0x44, 0xcc, 0x68, 0x27, 0x23, + 0x17, 0x87, 0x27, 0xd8, 0xa2, 0xd4, 0x22, 0xa1, 0x10, 0x2e, 0xe1, 0xe0, 0x92, 0xa2, 0xd4, 0xc4, + 0x5c, 0x5f, 0x88, 0xbe, 0xa0, 0xd4, 0x82, 0xfc, 0xa2, 0x12, 0x21, 0x45, 0x3d, 0x4c, 0x8b, 0xf5, + 0x50, 0x94, 0x48, 0x89, 0xe9, 0x41, 0xdc, 0xa1, 0x07, 0x73, 0x87, 0x9e, 0x2b, 0xc8, 0x1d, 0x4a, + 0x0c, 0x1a, 0x8c, 0x42, 0xe1, 0x5c, 0x82, 0x10, 0x53, 0x5d, 0x41, 0xf6, 0x42, 0xcd, 0x54, 0xc3, + 0x66, 0x26, 0xc4, 0x7d, 0x7a, 0x48, 0xea, 0xf0, 0x19, 0xec, 0x64, 0x7e, 0xe2, 0x91, 0x1c, 0xe3, + 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x46, 0x69, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0x0d, 0xd6, 0x07, 0x1b, 0xac, 0x5f, 0x9c, 0x92, 0xad, 0x5f, + 0x66, 0x04, 0x09, 0x20, 0x6b, 0x88, 0x29, 0x6c, 0x60, 0xca, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0x56, 0x21, 0x22, 0x28, 0x63, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// IngesterClient is the client API for Ingester service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type IngesterClient interface { + // A client-to-server streaming RPC to deliver high volume metrics reports. + StreamMetricsReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamMetricsReportClient, error) + // A client-to-server streaming RPC to deliver high volume event reports. + StreamEventReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamEventReportClient, error) +} + +type ingesterClient struct { + cc *grpc.ClientConn +} + +func NewIngesterClient(cc *grpc.ClientConn) IngesterClient { + return &ingesterClient{cc} +} + +func (c *ingesterClient) StreamMetricsReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamMetricsReportClient, error) { + stream, err := c.cc.NewStream(ctx, &_Ingester_serviceDesc.Streams[0], "/f5.nginx.agent.sdk.Ingester/StreamMetricsReport", opts...) + if err != nil { + return nil, err + } + x := &ingesterStreamMetricsReportClient{stream} + return x, nil +} + +type Ingester_StreamMetricsReportClient interface { + Send(*MetricsReport) error + CloseAndRecv() (*types.Empty, error) + grpc.ClientStream +} + +type ingesterStreamMetricsReportClient struct { + grpc.ClientStream +} + +func (x *ingesterStreamMetricsReportClient) Send(m *MetricsReport) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ingesterStreamMetricsReportClient) CloseAndRecv() (*types.Empty, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(types.Empty) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ingesterClient) StreamEventReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamEventReportClient, error) { + stream, err := c.cc.NewStream(ctx, &_Ingester_serviceDesc.Streams[1], "/f5.nginx.agent.sdk.Ingester/StreamEventReport", opts...) + if err != nil { + return nil, err + } + x := &ingesterStreamEventReportClient{stream} + return x, nil +} + +type Ingester_StreamEventReportClient interface { + Send(*events.EventReport) error + CloseAndRecv() (*types.Empty, error) + grpc.ClientStream +} + +type ingesterStreamEventReportClient struct { + grpc.ClientStream +} + +func (x *ingesterStreamEventReportClient) Send(m *events.EventReport) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ingesterStreamEventReportClient) CloseAndRecv() (*types.Empty, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(types.Empty) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// IngesterServer is the server API for Ingester service. +type IngesterServer interface { + // A client-to-server streaming RPC to deliver high volume metrics reports. + StreamMetricsReport(Ingester_StreamMetricsReportServer) error + // A client-to-server streaming RPC to deliver high volume event reports. + StreamEventReport(Ingester_StreamEventReportServer) error +} + +// UnimplementedIngesterServer can be embedded to have forward compatible implementations. +type UnimplementedIngesterServer struct { +} + +func (*UnimplementedIngesterServer) StreamMetricsReport(srv Ingester_StreamMetricsReportServer) error { + return status.Errorf(codes.Unimplemented, "method StreamMetricsReport not implemented") +} +func (*UnimplementedIngesterServer) StreamEventReport(srv Ingester_StreamEventReportServer) error { + return status.Errorf(codes.Unimplemented, "method StreamEventReport not implemented") +} + +func RegisterIngesterServer(s *grpc.Server, srv IngesterServer) { + s.RegisterService(&_Ingester_serviceDesc, srv) +} + +func _Ingester_StreamMetricsReport_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(IngesterServer).StreamMetricsReport(&ingesterStreamMetricsReportServer{stream}) +} + +type Ingester_StreamMetricsReportServer interface { + SendAndClose(*types.Empty) error + Recv() (*MetricsReport, error) + grpc.ServerStream +} + +type ingesterStreamMetricsReportServer struct { + grpc.ServerStream +} + +func (x *ingesterStreamMetricsReportServer) SendAndClose(m *types.Empty) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ingesterStreamMetricsReportServer) Recv() (*MetricsReport, error) { + m := new(MetricsReport) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Ingester_StreamEventReport_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(IngesterServer).StreamEventReport(&ingesterStreamEventReportServer{stream}) +} + +type Ingester_StreamEventReportServer interface { + SendAndClose(*types.Empty) error + Recv() (*events.EventReport, error) + grpc.ServerStream +} + +type ingesterStreamEventReportServer struct { + grpc.ServerStream +} + +func (x *ingesterStreamEventReportServer) SendAndClose(m *types.Empty) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ingesterStreamEventReportServer) Recv() (*events.EventReport, error) { + m := new(events.EventReport) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Ingester_serviceDesc = grpc.ServiceDesc{ + ServiceName: "f5.nginx.agent.sdk.Ingester", + HandlerType: (*IngesterServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamMetricsReport", + Handler: _Ingester_StreamMetricsReport_Handler, + ClientStreams: true, + }, + { + StreamName: "StreamEventReport", + Handler: _Ingester_StreamEventReport_Handler, + ClientStreams: true, + }, + }, + Metadata: "ingest_svc.proto", +} diff --git a/sdk/proto/ingest_svc.proto b/sdk/proto/ingest_svc.proto new file mode 100644 index 000000000..9c362e739 --- /dev/null +++ b/sdk/proto/ingest_svc.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package f5.nginx.agent.sdk; +option go_package = "github.com/nginx/agent/sdk/v2/proto;proto"; + +import "google/protobuf/empty.proto"; +import "metrics.proto"; +import "events/event.proto"; + +// Ingester is responsible for ingesting high volume metrics and events +service Ingester { + // A client-to-server streaming RPC to deliver high volume metrics reports. + rpc StreamMetricsReport(stream MetricsReport) returns (google.protobuf.Empty) {} + + // A client-to-server streaming RPC to deliver high volume event reports. + rpc StreamEventReport(stream f5.nginx.agent.sdk.events.EventReport) returns (google.protobuf.Empty) {} +} diff --git a/sdk/proto/metrics.svc.pb.go b/sdk/proto/metrics.svc.pb.go index fce099c19..698ca65fe 100644 --- a/sdk/proto/metrics.svc.pb.go +++ b/sdk/proto/metrics.svc.pb.go @@ -28,20 +28,20 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("metrics.svc.proto", fileDescriptor_ece8a4321458910f) } var fileDescriptor_ece8a4321458910f = []byte{ - // 194 bytes of a gzipped FileDescriptorProto + // 199 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcc, 0x4d, 0x2d, 0x29, 0xca, 0x4c, 0x2e, 0xd6, 0x2b, 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4a, 0x33, 0xd5, 0xcb, 0x4b, 0xcf, 0xcc, 0xab, 0xd0, 0x4b, 0x4c, 0x4f, 0xcd, 0x2b, 0xd1, 0x2b, 0x4e, 0xc9, 0x96, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xab, 0x48, 0x2a, 0x4d, 0xd3, - 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0x85, 0x99, 0x01, 0xe6, 0x1a, 0x45, 0x72, + 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0x85, 0x99, 0x01, 0xe6, 0x1a, 0xc5, 0x71, 0xf1, 0xf9, 0x42, 0x04, 0x82, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0x85, 0xdc, 0xb9, 0xd8, 0x82, 0x4b, 0x8a, 0x52, 0x13, 0x73, 0x85, 0x14, 0xf5, 0x30, 0x0d, 0xd7, 0x83, 0xaa, 0x0e, 0x4a, 0x2d, 0xc8, 0x2f, 0x2a, 0x91, 0x12, 0xd3, 0x83, 0xd8, 0xa5, 0x07, 0xb3, 0x4b, 0xcf, 0x15, 0x64, 0x97, - 0x12, 0x83, 0x06, 0xa3, 0x93, 0xf9, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, - 0x24, 0xc7, 0x18, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, - 0x36, 0x53, 0x1f, 0x6c, 0xa6, 0x7e, 0x71, 0x4a, 0xb6, 0x7e, 0x99, 0x11, 0xc4, 0xad, 0xd6, 0x10, - 0x53, 0xd8, 0xc0, 0x94, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x58, 0x03, 0x87, 0xd1, 0xef, 0x00, - 0x00, 0x00, + 0x12, 0x83, 0x06, 0xa3, 0x14, 0x73, 0x07, 0x13, 0xa3, 0x93, 0xf9, 0x89, 0x47, 0x72, 0x8c, 0x17, + 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x18, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, + 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x36, 0x58, 0x1f, 0x6c, 0xb0, 0x7e, 0x71, 0x4a, 0xb6, 0x7e, 0x99, + 0x11, 0xc4, 0xc1, 0xd6, 0x10, 0xa3, 0xd8, 0xc0, 0x94, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x04, + 0x53, 0x50, 0x03, 0xf4, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -55,6 +55,8 @@ const _ = grpc.SupportPackageIsVersion4 // MetricsServiceClient is the client API for MetricsService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +// +// Deprecated: Do not use. type MetricsServiceClient interface { // A client-to-server streaming RPC to deliver high volume metrics reports. Stream(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamClient, error) @@ -64,6 +66,7 @@ type metricsServiceClient struct { cc *grpc.ClientConn } +// Deprecated: Do not use. func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient { return &metricsServiceClient{cc} } @@ -103,11 +106,14 @@ func (x *metricsServiceStreamClient) CloseAndRecv() (*types.Empty, error) { } // MetricsServiceServer is the server API for MetricsService service. +// +// Deprecated: Do not use. type MetricsServiceServer interface { // A client-to-server streaming RPC to deliver high volume metrics reports. Stream(MetricsService_StreamServer) error } +// Deprecated: Do not use. // UnimplementedMetricsServiceServer can be embedded to have forward compatible implementations. type UnimplementedMetricsServiceServer struct { } @@ -116,6 +122,7 @@ func (*UnimplementedMetricsServiceServer) Stream(srv MetricsService_StreamServer return status.Errorf(codes.Unimplemented, "method Stream not implemented") } +// Deprecated: Do not use. func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) { s.RegisterService(&_MetricsService_serviceDesc, srv) } diff --git a/sdk/proto/metrics.svc.proto b/sdk/proto/metrics.svc.proto index 6da52b29d..62488ac44 100644 --- a/sdk/proto/metrics.svc.proto +++ b/sdk/proto/metrics.svc.proto @@ -7,6 +7,7 @@ import "metrics.proto"; // Interface exported by the server. service MetricsService { + option deprecated = true; // A client-to-server streaming RPC to deliver high volume metrics reports. rpc Stream(stream MetricsReport) returns (google.protobuf.Empty) {} diff --git a/src/plugins/events.go b/src/plugins/events.go index 9d8b38c8e..e0ceb89c0 100644 --- a/src/plugins/events.go +++ b/src/plugins/events.go @@ -38,8 +38,9 @@ const ( AGENT_EVENT_TYPE = "Agent" // Categories - STATUS_CATEGORY = "Status" - CONFIG_CATEGORY = "Config" + STATUS_CATEGORY = "Status" + CONFIG_CATEGORY = "Config" + APP_PROTECT_CATEGORY = "AppProtect" // Event Levels INFO_EVENT_LEVEL = "INFO" diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.pb.go b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.pb.go index 39b2e1760..00c7c1fb3 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.pb.go +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.pb.go @@ -124,6 +124,7 @@ type Event struct { Metadata *Metadata `protobuf:"bytes,1,opt,name=Metadata,proto3" json:"metadata"` // Types that are valid to be assigned to Data: // *Event_ActivityEvent + // *Event_SecurityViolationEvent Data isEvent_Data `protobuf_oneof:"data"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -172,8 +173,12 @@ type isEvent_Data interface { type Event_ActivityEvent struct { ActivityEvent *ActivityEvent `protobuf:"bytes,2,opt,name=ActivityEvent,proto3,oneof" json:"activity_event"` } +type Event_SecurityViolationEvent struct { + SecurityViolationEvent *SecurityViolationEvent `protobuf:"bytes,3,opt,name=SecurityViolationEvent,proto3,oneof" json:"security_violation_event"` +} -func (*Event_ActivityEvent) isEvent_Data() {} +func (*Event_ActivityEvent) isEvent_Data() {} +func (*Event_SecurityViolationEvent) isEvent_Data() {} func (m *Event) GetData() isEvent_Data { if m != nil { @@ -196,10 +201,18 @@ func (m *Event) GetActivityEvent() *ActivityEvent { return nil } +func (m *Event) GetSecurityViolationEvent() *SecurityViolationEvent { + if x, ok := m.GetData().(*Event_SecurityViolationEvent); ok { + return x.SecurityViolationEvent + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*Event) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Event_ActivityEvent)(nil), + (*Event_SecurityViolationEvent)(nil), } } @@ -305,450 +318,3591 @@ func (m *ActivityEvent) GetDimensions() []*common.Dimension { return nil } -func init() { - proto.RegisterType((*Metadata)(nil), "f5.nginx.agent.sdk.events.Metadata") - proto.RegisterType((*Event)(nil), "f5.nginx.agent.sdk.events.Event") - proto.RegisterType((*EventReport)(nil), "f5.nginx.agent.sdk.events.EventReport") - proto.RegisterType((*ActivityEvent)(nil), "f5.nginx.agent.sdk.events.ActivityEvent") +// SecurityViolationEvent represents a Security Violation that is emitted by the Agent +type SecurityViolationEvent struct { + DateTime string `protobuf:"bytes,1,opt,name=DateTime,proto3" json:"date_time"` + PolicyName string `protobuf:"bytes,2,opt,name=PolicyName,proto3" json:"policy_name"` + SupportID string `protobuf:"bytes,3,opt,name=SupportID,proto3" json:"support_id"` + Outcome string `protobuf:"bytes,4,opt,name=Outcome,proto3" json:"outcome"` + OutcomeReason string `protobuf:"bytes,5,opt,name=OutcomeReason,proto3" json:"outcome_reason"` + BlockingExceptionReason string `protobuf:"bytes,6,opt,name=BlockingExceptionReason,proto3" json:"blocking_exception_reason"` + Method string `protobuf:"bytes,7,opt,name=Method,proto3" json:"method"` + Protocol string `protobuf:"bytes,8,opt,name=Protocol,proto3" json:"protocol"` + XForwardedForHeaderValue string `protobuf:"bytes,9,opt,name=XForwardedForHeaderValue,proto3" json:"xff_header_value"` + URI string `protobuf:"bytes,10,opt,name=URI,proto3" json:"uri"` + Request string `protobuf:"bytes,11,opt,name=Request,proto3" json:"request"` + IsTruncated string `protobuf:"bytes,12,opt,name=IsTruncated,proto3" json:"is_truncated"` + RequestStatus string `protobuf:"bytes,13,opt,name=RequestStatus,proto3" json:"request_status"` + ResponseCode string `protobuf:"bytes,14,opt,name=ResponseCode,proto3" json:"response_code"` + GeoIP string `protobuf:"bytes,15,opt,name=GeoIP,proto3" json:"geo_ip"` + Host string `protobuf:"bytes,16,opt,name=Host,proto3" json:"host"` + UnitHostname string `protobuf:"bytes,17,opt,name=UnitHostname,proto3" json:"unit_hostname"` + SourceHost string `protobuf:"bytes,18,opt,name=SourceHost,proto3" json:"source_host"` + VSName string `protobuf:"bytes,19,opt,name=VSName,proto3" json:"vs_name"` + IPClient string `protobuf:"bytes,20,opt,name=IPClient,proto3" json:"ip_client"` + DestinationPort string `protobuf:"bytes,21,opt,name=DestinationPort,proto3" json:"destination_port"` + SourcePort string `protobuf:"bytes,22,opt,name=SourcePort,proto3" json:"source_port"` + Violations string `protobuf:"bytes,23,opt,name=Violations,proto3" json:"violations"` + SubViolations string `protobuf:"bytes,24,opt,name=SubViolations,proto3" json:"sub_violations"` + ViolationRating string `protobuf:"bytes,25,opt,name=ViolationRating,proto3" json:"violation_rating"` + SigID string `protobuf:"bytes,26,opt,name=SigID,proto3" json:"sig_id"` + SigNames string `protobuf:"bytes,27,opt,name=SigNames,proto3" json:"sig_names"` + SigSetNames string `protobuf:"bytes,28,opt,name=SigSetNames,proto3" json:"sig_set_names"` + SigCVEs string `protobuf:"bytes,29,opt,name=SigCVEs,proto3" json:"sig_cves"` + ClientClass string `protobuf:"bytes,30,opt,name=ClientClass,proto3" json:"client_class"` + ClientApplication string `protobuf:"bytes,31,opt,name=ClientApplication,proto3" json:"client_application"` + ClientApplicationVersion string `protobuf:"bytes,32,opt,name=ClientApplicationVersion,proto3" json:"client_application_version"` + Severity string `protobuf:"bytes,33,opt,name=Severity,proto3" json:"severity"` + // NOTE: Severity Label might be deprecated if we have no use for it + SeverityLabel string `protobuf:"bytes,34,opt,name=SeverityLabel,proto3" json:"severity_label"` + Priority string `protobuf:"bytes,35,opt,name=Priority,proto3" json:"priority"` + ThreatCampaignNames string `protobuf:"bytes,36,opt,name=ThreatCampaignNames,proto3" json:"threat_campaign_names"` + BotAnomalies string `protobuf:"bytes,37,opt,name=BotAnomalies,proto3" json:"bot_anomalies"` + BotCategory string `protobuf:"bytes,38,opt,name=BotCategory,proto3" json:"bot_category"` + EnforcedBotAnomalies string `protobuf:"bytes,39,opt,name=EnforcedBotAnomalies,proto3" json:"enforced_bot_anomalies"` + BotSignatureName string `protobuf:"bytes,40,opt,name=BotSignatureName,proto3" json:"bot_signature_name"` + ViolationContexts string `protobuf:"bytes,41,opt,name=ViolationContexts,proto3" json:"violation_contexts"` + ViolationsData []*ViolationData `protobuf:"bytes,42,rep,name=ViolationsData,proto3" json:"violations_data"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } - -var fileDescriptor_2d17a9d3f0ddf27e = []byte{ - // 512 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcf, 0x6e, 0xd3, 0x4c, - 0x14, 0xc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0x09, 0x3a, 0x2e, 0x53, - 0x53, 0x9b, 0x9c, 0xcd, 0x8c, 0xf9, 0xe4, 0x91, 0x53, 0x95, 0x11, 0x4e, 0x8d, 0x52, 0x68, 0xb5, - 0x77, 0xfa, 0x43, 0xfb, 0x2b, 0x03, 0x79, 0x05, 0xbd, 0x15, 0x4b, 0x53, 0xd7, 0xaf, 0x87, 0xcd, - 0x28, 0x72, 0xab, 0x17, 0x2a, 0x89, 0xd6, 0x35, 0xb2, 0x06, 0x58, 0xf2, 0x90, 0x45, 0x29, 0x17, - 0x51, 0x6a, 0x76, 0xf0, 0x0a, 0x2f, 0xff, 0x75, 0x85, 0x6a, 0xaa, 0x1b, 0x78, 0x71, 0x51, 0xe4, - 0x16, 0x78, 0xcd, 0x5e, 0x7a, 0xcf, 0x67, 0x41, 0xef, 0x8e, 0x63, 0xed, 0xd7, 0x71, 0xac, 0xfd, - 0x3e, 0x8e, 0xb5, 0xaf, 0x4b, 0x9f, 0xcb, 0x6f, 0xd9, 0xb6, 0xb4, 0x70, 0xd0, 0xd6, 0x41, 0x5b, - 0x27, 0xf5, 0x6e, 0x9d, 0xfd, 0x5c, 0xfd, 0x50, 0x8e, 0x0a, 0xf4, 0xee, 0xc1, 0xf0, 0x5b, 0x1d, - 0xb9, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x99, 0xea, 0x62, 0xfe, 0xbc, 0x03, 0x00, 0x00, +func (m *SecurityViolationEvent) Reset() { *m = SecurityViolationEvent{} } +func (m *SecurityViolationEvent) String() string { return proto.CompactTextString(m) } +func (*SecurityViolationEvent) ProtoMessage() {} +func (*SecurityViolationEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{4} } - -func (m *Metadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SecurityViolationEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SecurityViolationEvent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil } - -func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityViolationEvent.Merge(m, src) +} +func (m *SecurityViolationEvent) XXX_Size() int { + return m.Size() +} +func (m *SecurityViolationEvent) XXX_DiscardUnknown() { + xxx_messageInfo_SecurityViolationEvent.DiscardUnknown(m) } -func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Category) > 0 { - i -= len(m.Category) - copy(dAtA[i:], m.Category) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Category))) - i-- - dAtA[i] = 0x3a - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x32 +var xxx_messageInfo_SecurityViolationEvent proto.InternalMessageInfo + +func (m *SecurityViolationEvent) GetDateTime() string { + if m != nil { + return m.DateTime } - if len(m.EventLevel) > 0 { - i -= len(m.EventLevel) - copy(dAtA[i:], m.EventLevel) - i = encodeVarintEvent(dAtA, i, uint64(len(m.EventLevel))) - i-- - dAtA[i] = 0x2a + return "" +} + +func (m *SecurityViolationEvent) GetPolicyName() string { + if m != nil { + return m.PolicyName } - if m.Timestamp != nil { - { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 + return "" +} + +func (m *SecurityViolationEvent) GetSupportID() string { + if m != nil { + return m.SupportID } - if len(m.CorrelationID) > 0 { - i -= len(m.CorrelationID) - copy(dAtA[i:], m.CorrelationID) - i = encodeVarintEvent(dAtA, i, uint64(len(m.CorrelationID))) - i-- - dAtA[i] = 0x1a + return "" +} + +func (m *SecurityViolationEvent) GetOutcome() string { + if m != nil { + return m.Outcome } - if len(m.UUID) > 0 { - i -= len(m.UUID) - copy(dAtA[i:], m.UUID) - i = encodeVarintEvent(dAtA, i, uint64(len(m.UUID))) - i-- - dAtA[i] = 0x12 + return "" +} + +func (m *SecurityViolationEvent) GetOutcomeReason() string { + if m != nil { + return m.OutcomeReason } - if len(m.Module) > 0 { - i -= len(m.Module) - copy(dAtA[i:], m.Module) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Module))) - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetBlockingExceptionReason() string { + if m != nil { + return m.BlockingExceptionReason } - return len(dAtA) - i, nil + return "" } -func (m *Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) GetMethod() string { + if m != nil { + return m.Method } - return dAtA[:n], nil + return "" } -func (m *Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" } -func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) +func (m *SecurityViolationEvent) GetXForwardedForHeaderValue() string { + if m != nil { + return m.XForwardedForHeaderValue } - if m.Data != nil { - { - size := m.Data.Size() - i -= size - if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + return "" +} + +func (m *SecurityViolationEvent) GetURI() string { + if m != nil { + return m.URI } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetRequest() string { + if m != nil { + return m.Request } - return len(dAtA) - i, nil + return "" } -func (m *Event_ActivityEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetIsTruncated() string { + if m != nil { + return m.IsTruncated + } + return "" } -func (m *Event_ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ActivityEvent != nil { - { - size, err := m.ActivityEvent.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (m *SecurityViolationEvent) GetRequestStatus() string { + if m != nil { + return m.RequestStatus } - return len(dAtA) - i, nil + return "" } -func (m *EventReport) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + +func (m *SecurityViolationEvent) GetResponseCode() string { + if m != nil { + return m.ResponseCode } - return dAtA[:n], nil + return "" } -func (m *EventReport) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetGeoIP() string { + if m != nil { + return m.GeoIP + } + return "" } -func (m *EventReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) +func (m *SecurityViolationEvent) GetHost() string { + if m != nil { + return m.Host } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + return "" +} + +func (m *SecurityViolationEvent) GetUnitHostname() string { + if m != nil { + return m.UnitHostname } - return len(dAtA) - i, nil + return "" } -func (m *ActivityEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) GetSourceHost() string { + if m != nil { + return m.SourceHost } - return dAtA[:n], nil + return "" } -func (m *ActivityEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetVSName() string { + if m != nil { + return m.VSName + } + return "" } -func (m *ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Dimensions) > 0 { - for iNdEx := len(m.Dimensions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Dimensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } +func (m *SecurityViolationEvent) GetIPClient() string { + if m != nil { + return m.IPClient } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetDestinationPort() string { + if m != nil { + return m.DestinationPort } - return len(dAtA) - i, nil + return "" } -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *SecurityViolationEvent) GetSourcePort() string { + if m != nil { + return m.SourcePort } - dAtA[offset] = uint8(v) - return base + return "" } -func (m *Metadata) Size() (n int) { - if m == nil { - return 0 + +func (m *SecurityViolationEvent) GetViolations() string { + if m != nil { + return m.Violations } - var l int - _ = l - l = len(m.Module) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSubViolations() string { + if m != nil { + return m.SubViolations } - l = len(m.UUID) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetViolationRating() string { + if m != nil { + return m.ViolationRating } - l = len(m.CorrelationID) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigID() string { + if m != nil { + return m.SigID } - if m.Timestamp != nil { - l = m.Timestamp.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigNames() string { + if m != nil { + return m.SigNames } - l = len(m.EventLevel) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigSetNames() string { + if m != nil { + return m.SigSetNames } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigCVEs() string { + if m != nil { + return m.SigCVEs } - l = len(m.Category) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetClientClass() string { + if m != nil { + return m.ClientClass } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetClientApplication() string { + if m != nil { + return m.ClientApplication } - return n + return "" } -func (m *Event) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetClientApplicationVersion() string { + if m != nil { + return m.ClientApplicationVersion } - var l int - _ = l - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSeverity() string { + if m != nil { + return m.Severity } - if m.Data != nil { - n += m.Data.Size() + return "" +} + +func (m *SecurityViolationEvent) GetSeverityLabel() string { + if m != nil { + return m.SeverityLabel } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetPriority() string { + if m != nil { + return m.Priority } - return n + return "" } -func (m *Event_ActivityEvent) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetThreatCampaignNames() string { + if m != nil { + return m.ThreatCampaignNames } - var l int - _ = l - if m.ActivityEvent != nil { - l = m.ActivityEvent.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetBotAnomalies() string { + if m != nil { + return m.BotAnomalies } - return n + return "" } -func (m *EventReport) Size() (n int) { - if m == nil { - return 0 + +func (m *SecurityViolationEvent) GetBotCategory() string { + if m != nil { + return m.BotCategory } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovEvent(uint64(l)) - } + return "" +} + +func (m *SecurityViolationEvent) GetEnforcedBotAnomalies() string { + if m != nil { + return m.EnforcedBotAnomalies } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetBotSignatureName() string { + if m != nil { + return m.BotSignatureName } - return n + return "" } -func (m *ActivityEvent) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetViolationContexts() string { + if m != nil { + return m.ViolationContexts } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetViolationsData() []*ViolationData { + if m != nil { + return m.ViolationsData } - if len(m.Dimensions) > 0 { - for _, e := range m.Dimensions { - l = e.Size() - n += 1 + l + sovEvent(uint64(l)) + return nil +} + +type SignatureData struct { + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"sig_data_id"` + Buffer string `protobuf:"bytes,2,opt,name=Buffer,proto3" json:"sig_data_buffer"` + Offset string `protobuf:"bytes,3,opt,name=Offset,proto3" json:"sig_data_offset"` + Length string `protobuf:"bytes,4,opt,name=Length,proto3" json:"sig_data_length"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignatureData) Reset() { *m = SignatureData{} } +func (m *SignatureData) String() string { return proto.CompactTextString(m) } +func (*SignatureData) ProtoMessage() {} +func (*SignatureData) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{5} +} +func (m *SignatureData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignatureData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +} +func (m *SignatureData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignatureData.Merge(m, src) +} +func (m *SignatureData) XXX_Size() int { + return m.Size() +} +func (m *SignatureData) XXX_DiscardUnknown() { + xxx_messageInfo_SignatureData.DiscardUnknown(m) +} + +var xxx_messageInfo_SignatureData proto.InternalMessageInfo + +func (m *SignatureData) GetID() string { + if m != nil { + return m.ID } - return n + return "" } -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *SignatureData) GetBuffer() string { + if m != nil { + return m.Buffer + } + return "" } -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *SignatureData) GetOffset() string { + if m != nil { + return m.Offset + } + return "" } -func (m *Metadata) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + +func (m *SignatureData) GetLength() string { + if m != nil { + return m.Length + } + return "" +} + +type ViolationData struct { + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"violation_data_name"` + Context string `protobuf:"bytes,2,opt,name=Context,proto3" json:"violation_data_context"` + ParameterName string `protobuf:"bytes,3,opt,name=ParameterName,proto3" json:"violation_data_param_name"` + ParamaterValue string `protobuf:"bytes,4,opt,name=ParamaterValue,proto3" json:"violation_data_param_value"` + Signatures []*SignatureData `protobuf:"bytes,5,rep,name=Signatures,proto3" json:"violation_data_signatures"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ViolationData) Reset() { *m = ViolationData{} } +func (m *ViolationData) String() string { return proto.CompactTextString(m) } +func (*ViolationData) ProtoMessage() {} +func (*ViolationData) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{6} +} +func (m *ViolationData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ViolationData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ViolationData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - if fieldNum <= 0 { - return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + return b[:n], nil + } +} +func (m *ViolationData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ViolationData.Merge(m, src) +} +func (m *ViolationData) XXX_Size() int { + return m.Size() +} +func (m *ViolationData) XXX_DiscardUnknown() { + xxx_messageInfo_ViolationData.DiscardUnknown(m) +} + +var xxx_messageInfo_ViolationData proto.InternalMessageInfo + +func (m *ViolationData) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ViolationData) GetContext() string { + if m != nil { + return m.Context + } + return "" +} + +func (m *ViolationData) GetParameterName() string { + if m != nil { + return m.ParameterName + } + return "" +} + +func (m *ViolationData) GetParamaterValue() string { + if m != nil { + return m.ParamaterValue + } + return "" +} + +func (m *ViolationData) GetSignatures() []*SignatureData { + if m != nil { + return m.Signatures + } + return nil +} + +func init() { + proto.RegisterType((*Metadata)(nil), "f5.nginx.agent.sdk.events.Metadata") + proto.RegisterType((*Event)(nil), "f5.nginx.agent.sdk.events.Event") + proto.RegisterType((*EventReport)(nil), "f5.nginx.agent.sdk.events.EventReport") + proto.RegisterType((*ActivityEvent)(nil), "f5.nginx.agent.sdk.events.ActivityEvent") + proto.RegisterType((*SecurityViolationEvent)(nil), "f5.nginx.agent.sdk.events.SecurityViolationEvent") + proto.RegisterType((*SignatureData)(nil), "f5.nginx.agent.sdk.events.SignatureData") + proto.RegisterType((*ViolationData)(nil), "f5.nginx.agent.sdk.events.ViolationData") +} + +func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } + +var fileDescriptor_2d17a9d3f0ddf27e = []byte{ + // 1620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x57, 0xdd, 0x6e, 0xdb, 0xc8, + 0x15, 0xae, 0x6c, 0xc7, 0x3f, 0xa3, 0xc8, 0x49, 0xc6, 0xd9, 0x64, 0xec, 0x66, 0x4d, 0x57, 0xd9, + 0xdd, 0x7a, 0xbb, 0x85, 0x84, 0x7a, 0xbb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0x13, 0x22, + 0xd7, 0x8c, 0xe7, 0x2c, 0xd5, 0x7f, 0x39, 0xc8, 0x11, 0x38, 0x3b, 0x2c, 0x72, 0xef, 0xe0, 0xba, + 0x33, 0x7f, 0x65, 0x58, 0xf4, 0x56, 0xbd, 0xde, 0x7a, 0x13, 0xb6, 0x62, 0xfa, 0xef, 0x0e, 0xf9, + 0x55, 0xed, 0xfa, 0xd6, 0x46, 0x2b, 0x14, 0x7a, 0xc4, 0xfe, 0x7e, 0x13, 0x4c, 0xd9, 0x9c, 0x74, + 0x6b, 0x3d, 0x62, 0x01, 0x7f, 0xae, 0x11, 0xda, 0x24, 0x9a, 0xcd, 0xca, 0x05, 0xc4, 0x78, 0x5e, + 0xdf, 0xac, 0xc6, 0x46, 0x2b, 0x14, 0xff, 0x19, 0xed, 0x9d, 0x5d, 0xa4, 0x2c, 0x50, 0xc3, 0x60, + 0xb1, 0x0c, 0x78, 0x9c, 0x98, 0x42, 0x7e, 0x01, 0xa2, 0xfd, 0x22, 0xf7, 0x3e, 0x53, 0x00, 0xfb, + 0xa1, 0xc5, 0x6d, 0x41, 0x6f, 0x52, 0xe9, 0x6d, 0x31, 0x10, 0xea, 0x45, 0x22, 0x16, 0xc1, 0x9c, + 0x33, 0x49, 0xbe, 0x74, 0xed, 0x30, 0x15, 0xca, 0x0f, 0x4a, 0x80, 0x36, 0x68, 0xba, 0xce, 0x03, + 0xa1, 0xaa, 0xe7, 0xde, 0x57, 0xae, 0xce, 0x5a, 0x55, 0x3d, 0xf9, 0xea, 0x24, 0xfc, 0x03, 0x7a, + 0xfc, 0x32, 0x99, 0x89, 0x34, 0x64, 0x51, 0x23, 0xe4, 0xaf, 0x41, 0x7c, 0x50, 0xe4, 0xde, 0x13, + 0x66, 0x71, 0xbf, 0x19, 0xfb, 0x46, 0x1d, 0x1e, 0xa0, 0x87, 0x03, 0xa1, 0x26, 0x3c, 0x4e, 0x02, + 0x95, 0xa5, 0x0c, 0x56, 0xd1, 0xb1, 0x6b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0b, 0xa6, 0x58, + 0x0a, 0xb1, 0xd6, 0xdd, 0xf3, 0xe8, 0x8a, 0x76, 0xa9, 0x79, 0x26, 0x62, 0x53, 0x83, 0x5f, 0xa1, + 0x5d, 0x30, 0x04, 0xaa, 0x7c, 0xbc, 0x6c, 0xb8, 0x65, 0x72, 0xa3, 0x17, 0xf3, 0x8c, 0xb9, 0xa2, + 0xc2, 0x31, 0x42, 0x55, 0xe9, 0x24, 0xb9, 0xf7, 0x7f, 0xdb, 0xa3, 0x51, 0xe7, 0x1b, 0xcf, 0x5c, + 0xf5, 0xb6, 0xa4, 0x35, 0xd7, 0x03, 0xfa, 0xf3, 0xa7, 0xc3, 0xd6, 0xc7, 0x4f, 0x87, 0xad, 0x7f, + 0x7f, 0x3a, 0x6c, 0xfd, 0x34, 0x8a, 0xb9, 0xba, 0xc8, 0xa6, 0xfa, 0x9d, 0xdd, 0x87, 0x48, 0x7d, + 0x88, 0xd4, 0x97, 0xd1, 0xfb, 0xfe, 0xea, 0xc4, 0xfc, 0x0f, 0xb8, 0x6f, 0x42, 0xfe, 0xf1, 0xd6, + 0xc3, 0x4c, 0x37, 0x81, 0xf7, 0xed, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, 0x39, 0xb9, 0x5d, + 0x6d, 0x0f, 0x00, 0x00, +} + +func (m *Metadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Category) > 0 { + i -= len(m.Category) + copy(dAtA[i:], m.Category) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Category))) + i-- + dAtA[i] = 0x3a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x32 + } + if len(m.EventLevel) > 0 { + i -= len(m.EventLevel) + copy(dAtA[i:], m.EventLevel) + i = encodeVarintEvent(dAtA, i, uint64(len(m.EventLevel))) + i-- + dAtA[i] = 0x2a + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) } - switch fieldNum { - case 1: + i-- + dAtA[i] = 0x22 + } + if len(m.CorrelationID) > 0 { + i -= len(m.CorrelationID) + copy(dAtA[i:], m.CorrelationID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.CorrelationID))) + i-- + dAtA[i] = 0x1a + } + if len(m.UUID) > 0 { + i -= len(m.UUID) + copy(dAtA[i:], m.UUID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.UUID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Event) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Event) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Data != nil { + { + size := m.Data.Size() + i -= size + if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Event_ActivityEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event_ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ActivityEvent != nil { + { + size, err := m.ActivityEvent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Event_SecurityViolationEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event_SecurityViolationEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SecurityViolationEvent != nil { + { + size, err := m.SecurityViolationEvent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *EventReport) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventReport) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ActivityEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ActivityEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Dimensions) > 0 { + for iNdEx := len(m.Dimensions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dimensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SecurityViolationEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SecurityViolationEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecurityViolationEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ViolationsData) > 0 { + for iNdEx := len(m.ViolationsData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ViolationsData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xd2 + } + } + if len(m.ViolationContexts) > 0 { + i -= len(m.ViolationContexts) + copy(dAtA[i:], m.ViolationContexts) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ViolationContexts))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xca + } + if len(m.BotSignatureName) > 0 { + i -= len(m.BotSignatureName) + copy(dAtA[i:], m.BotSignatureName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotSignatureName))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xc2 + } + if len(m.EnforcedBotAnomalies) > 0 { + i -= len(m.EnforcedBotAnomalies) + copy(dAtA[i:], m.EnforcedBotAnomalies) + i = encodeVarintEvent(dAtA, i, uint64(len(m.EnforcedBotAnomalies))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xba + } + if len(m.BotCategory) > 0 { + i -= len(m.BotCategory) + copy(dAtA[i:], m.BotCategory) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotCategory))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xb2 + } + if len(m.BotAnomalies) > 0 { + i -= len(m.BotAnomalies) + copy(dAtA[i:], m.BotAnomalies) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotAnomalies))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xaa + } + if len(m.ThreatCampaignNames) > 0 { + i -= len(m.ThreatCampaignNames) + copy(dAtA[i:], m.ThreatCampaignNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ThreatCampaignNames))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xa2 + } + if len(m.Priority) > 0 { + i -= len(m.Priority) + copy(dAtA[i:], m.Priority) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Priority))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x9a + } + if len(m.SeverityLabel) > 0 { + i -= len(m.SeverityLabel) + copy(dAtA[i:], m.SeverityLabel) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SeverityLabel))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 + } + if len(m.Severity) > 0 { + i -= len(m.Severity) + copy(dAtA[i:], m.Severity) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Severity))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x8a + } + if len(m.ClientApplicationVersion) > 0 { + i -= len(m.ClientApplicationVersion) + copy(dAtA[i:], m.ClientApplicationVersion) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientApplicationVersion))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + } + if len(m.ClientApplication) > 0 { + i -= len(m.ClientApplication) + copy(dAtA[i:], m.ClientApplication) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientApplication))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + if len(m.ClientClass) > 0 { + i -= len(m.ClientClass) + copy(dAtA[i:], m.ClientClass) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientClass))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + if len(m.SigCVEs) > 0 { + i -= len(m.SigCVEs) + copy(dAtA[i:], m.SigCVEs) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigCVEs))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xea + } + if len(m.SigSetNames) > 0 { + i -= len(m.SigSetNames) + copy(dAtA[i:], m.SigSetNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigSetNames))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe2 + } + if len(m.SigNames) > 0 { + i -= len(m.SigNames) + copy(dAtA[i:], m.SigNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigNames))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xda + } + if len(m.SigID) > 0 { + i -= len(m.SigID) + copy(dAtA[i:], m.SigID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigID))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + if len(m.ViolationRating) > 0 { + i -= len(m.ViolationRating) + copy(dAtA[i:], m.ViolationRating) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ViolationRating))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + if len(m.SubViolations) > 0 { + i -= len(m.SubViolations) + copy(dAtA[i:], m.SubViolations) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SubViolations))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(m.Violations) > 0 { + i -= len(m.Violations) + copy(dAtA[i:], m.Violations) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Violations))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.SourcePort) > 0 { + i -= len(m.SourcePort) + copy(dAtA[i:], m.SourcePort) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourcePort))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if len(m.DestinationPort) > 0 { + i -= len(m.DestinationPort) + copy(dAtA[i:], m.DestinationPort) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DestinationPort))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if len(m.IPClient) > 0 { + i -= len(m.IPClient) + copy(dAtA[i:], m.IPClient) + i = encodeVarintEvent(dAtA, i, uint64(len(m.IPClient))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if len(m.VSName) > 0 { + i -= len(m.VSName) + copy(dAtA[i:], m.VSName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.VSName))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if len(m.SourceHost) > 0 { + i -= len(m.SourceHost) + copy(dAtA[i:], m.SourceHost) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourceHost))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.UnitHostname) > 0 { + i -= len(m.UnitHostname) + copy(dAtA[i:], m.UnitHostname) + i = encodeVarintEvent(dAtA, i, uint64(len(m.UnitHostname))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.GeoIP) > 0 { + i -= len(m.GeoIP) + copy(dAtA[i:], m.GeoIP) + i = encodeVarintEvent(dAtA, i, uint64(len(m.GeoIP))) + i-- + dAtA[i] = 0x7a + } + if len(m.ResponseCode) > 0 { + i -= len(m.ResponseCode) + copy(dAtA[i:], m.ResponseCode) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ResponseCode))) + i-- + dAtA[i] = 0x72 + } + if len(m.RequestStatus) > 0 { + i -= len(m.RequestStatus) + copy(dAtA[i:], m.RequestStatus) + i = encodeVarintEvent(dAtA, i, uint64(len(m.RequestStatus))) + i-- + dAtA[i] = 0x6a + } + if len(m.IsTruncated) > 0 { + i -= len(m.IsTruncated) + copy(dAtA[i:], m.IsTruncated) + i = encodeVarintEvent(dAtA, i, uint64(len(m.IsTruncated))) + i-- + dAtA[i] = 0x62 + } + if len(m.Request) > 0 { + i -= len(m.Request) + copy(dAtA[i:], m.Request) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Request))) + i-- + dAtA[i] = 0x5a + } + if len(m.URI) > 0 { + i -= len(m.URI) + copy(dAtA[i:], m.URI) + i = encodeVarintEvent(dAtA, i, uint64(len(m.URI))) + i-- + dAtA[i] = 0x52 + } + if len(m.XForwardedForHeaderValue) > 0 { + i -= len(m.XForwardedForHeaderValue) + copy(dAtA[i:], m.XForwardedForHeaderValue) + i = encodeVarintEvent(dAtA, i, uint64(len(m.XForwardedForHeaderValue))) + i-- + dAtA[i] = 0x4a + } + if len(m.Protocol) > 0 { + i -= len(m.Protocol) + copy(dAtA[i:], m.Protocol) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Protocol))) + i-- + dAtA[i] = 0x42 + } + if len(m.Method) > 0 { + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x3a + } + if len(m.BlockingExceptionReason) > 0 { + i -= len(m.BlockingExceptionReason) + copy(dAtA[i:], m.BlockingExceptionReason) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BlockingExceptionReason))) + i-- + dAtA[i] = 0x32 + } + if len(m.OutcomeReason) > 0 { + i -= len(m.OutcomeReason) + copy(dAtA[i:], m.OutcomeReason) + i = encodeVarintEvent(dAtA, i, uint64(len(m.OutcomeReason))) + i-- + dAtA[i] = 0x2a + } + if len(m.Outcome) > 0 { + i -= len(m.Outcome) + copy(dAtA[i:], m.Outcome) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Outcome))) + i-- + dAtA[i] = 0x22 + } + if len(m.SupportID) > 0 { + i -= len(m.SupportID) + copy(dAtA[i:], m.SupportID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SupportID))) + i-- + dAtA[i] = 0x1a + } + if len(m.PolicyName) > 0 { + i -= len(m.PolicyName) + copy(dAtA[i:], m.PolicyName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.PolicyName))) + i-- + dAtA[i] = 0x12 + } + if len(m.DateTime) > 0 { + i -= len(m.DateTime) + copy(dAtA[i:], m.DateTime) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DateTime))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SignatureData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SignatureData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Length) > 0 { + i -= len(m.Length) + copy(dAtA[i:], m.Length) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Length))) + i-- + dAtA[i] = 0x22 + } + if len(m.Offset) > 0 { + i -= len(m.Offset) + copy(dAtA[i:], m.Offset) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Offset))) + i-- + dAtA[i] = 0x1a + } + if len(m.Buffer) > 0 { + i -= len(m.Buffer) + copy(dAtA[i:], m.Buffer) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Buffer))) + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ViolationData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ViolationData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ViolationData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.ParamaterValue) > 0 { + i -= len(m.ParamaterValue) + copy(dAtA[i:], m.ParamaterValue) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ParamaterValue))) + i-- + dAtA[i] = 0x22 + } + if len(m.ParameterName) > 0 { + i -= len(m.ParameterName) + copy(dAtA[i:], m.ParameterName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ParameterName))) + i-- + dAtA[i] = 0x1a + } + if len(m.Context) > 0 { + i -= len(m.Context) + copy(dAtA[i:], m.Context) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Context))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Module) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.UUID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.CorrelationID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.Timestamp != nil { + l = m.Timestamp.Size() + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.EventLevel) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Category) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Event) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.Data != nil { + n += m.Data.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Event_ActivityEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ActivityEvent != nil { + l = m.ActivityEvent.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} +func (m *Event_SecurityViolationEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SecurityViolationEvent != nil { + l = m.SecurityViolationEvent.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} +func (m *EventReport) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ActivityEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if len(m.Dimensions) > 0 { + for _, e := range m.Dimensions { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SecurityViolationEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DateTime) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.PolicyName) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.SupportID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Outcome) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.OutcomeReason) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.BlockingExceptionReason) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Method) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Protocol) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.XForwardedForHeaderValue) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.URI) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Request) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.IsTruncated) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.RequestStatus) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ResponseCode) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.GeoIP) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Host) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.UnitHostname) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SourceHost) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.VSName) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.IPClient) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.DestinationPort) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SourcePort) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Violations) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SubViolations) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ViolationRating) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigID) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigSetNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigCVEs) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientClass) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientApplication) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientApplicationVersion) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Severity) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SeverityLabel) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Priority) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ThreatCampaignNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotAnomalies) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotCategory) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.EnforcedBotAnomalies) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotSignatureName) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ViolationContexts) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + if len(m.ViolationsData) > 0 { + for _, e := range m.ViolationsData { + l = e.Size() + n += 2 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Buffer) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Offset) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Length) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ViolationData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Context) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ParameterName) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ParamaterValue) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if len(m.Signatures) > 0 { + for _, e := range m.Signatures { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Metadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UUID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UUID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorrelationID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CorrelationID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = &types.Timestamp{} + } + if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventLevel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventLevel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Category = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Event) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Event: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivityEvent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ActivityEvent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Event_ActivityEvent{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityViolationEvent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SecurityViolationEvent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Event_SecurityViolationEvent{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventReport) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventReport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventReport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, &Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ActivityEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ActivityEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ActivityEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dimensions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Dimensions = append(m.Dimensions, &common.Dimension{}) + if err := m.Dimensions[len(m.Dimensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SecurityViolationEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SecurityViolationEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SecurityViolationEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DateTime", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DateTime = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupportID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupportID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Outcome", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Outcome = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutcomeReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutcomeReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockingExceptionReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockingExceptionReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Protocol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field XForwardedForHeaderValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XForwardedForHeaderValue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Request = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IsTruncated", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IsTruncated = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseCode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResponseCode = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GeoIP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GeoIP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnitHostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UnitHostname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceHost", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceHost = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VSName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VSName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IPClient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IPClient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourcePort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Violations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Violations = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubViolations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubViolations = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ViolationRating", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ViolationRating = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 27: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigNames = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 28: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigSetNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigSetNames = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 29: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigCVEs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigCVEs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientClass", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientClass = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientApplication", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientApplication = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 32: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientApplicationVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientApplicationVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 33: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Severity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Severity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeverityLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SeverityLabel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 35: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Priority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 36: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ThreatCampaignNames", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -776,11 +3930,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Module = string(dAtA[iNdEx:postIndex]) + m.ThreatCampaignNames = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 37: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UUID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotAnomalies", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -808,11 +3962,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UUID = string(dAtA[iNdEx:postIndex]) + m.BotAnomalies = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 38: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CorrelationID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotCategory", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -840,13 +3994,13 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CorrelationID = string(dAtA[iNdEx:postIndex]) + m.BotCategory = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 39: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EnforcedBotAnomalies", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -856,31 +4010,27 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Timestamp == nil { - m.Timestamp = &types.Timestamp{} - } - if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EnforcedBotAnomalies = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 40: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EventLevel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotSignatureName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -908,11 +4058,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.EventLevel = string(dAtA[iNdEx:postIndex]) + m.BotSignatureName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 41: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ViolationContexts", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -940,13 +4090,13 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.ViolationContexts = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 42: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ViolationsData", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -956,23 +4106,25 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - m.Category = string(dAtA[iNdEx:postIndex]) + m.ViolationsData = append(m.ViolationsData, &ViolationData{}) + if err := m.ViolationsData[len(m.ViolationsData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -996,7 +4148,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *Event) Unmarshal(dAtA []byte) error { +func (m *SignatureData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1019,17 +4171,17 @@ func (m *Event) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Event: wiretype end group for non-group") + return fmt.Errorf("proto: SignatureData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignatureData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1039,33 +4191,61 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Metadata == nil { - m.Metadata = &Metadata{} + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.Buffer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActivityEvent", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1075,26 +4255,55 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - v := &ActivityEvent{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Offset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) } - m.Data = &Event_ActivityEvent{v} + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Length = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1118,7 +4327,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } return nil } -func (m *EventReport) Unmarshal(dAtA []byte) error { +func (m *ViolationData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1141,17 +4350,17 @@ func (m *EventReport) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventReport: wiretype end group for non-group") + return fmt.Errorf("proto: ViolationData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventReport: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ViolationData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1161,80 +4370,91 @@ func (m *EventReport) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, &Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActivityEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent + m.Context = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterName", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActivityEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActivityEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ParameterName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ParamaterValue", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1262,11 +4482,11 @@ func (m *ActivityEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Message = string(dAtA[iNdEx:postIndex]) + m.ParamaterValue = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dimensions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1293,8 +4513,8 @@ func (m *ActivityEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Dimensions = append(m.Dimensions, &common.Dimension{}) - if err := m.Dimensions[len(m.Dimensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Signatures = append(m.Signatures, &SignatureData{}) + if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto index a7e4f4c27..143cb259e 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto @@ -20,6 +20,19 @@ message Event { Metadata Metadata = 1 [(gogoproto.jsontag) = "metadata" ]; oneof data { ActivityEvent ActivityEvent = 2 [(gogoproto.jsontag) = "activity_event" ]; + + // While generating the SecurityViolationEvent, the Metadata for a SecurityViolationEvent + // would look as shown below: + // * Module = Agent + // * UUID = A UUID generated by the Agent for the EventReport + // * CorrelationID = The UUID will be used as the Correlation ID to track the EventReport + // * Timestamp = The timestamp when NGINX Agent received the violation event + // * EventLevel = All the SecurityViolationEvent would be generated at an ERROR_EVENT_LEVEL ("ERROR") level + // In future, the levels might be dynamically chosen based on Request Outcome of SecurityViolationEvent + // * Type = NGINX_EVENT_TYPE ("Nginx") + // * Category = APP_PROTECT_CATEGORY ("AppProtect") + // + SecurityViolationEvent SecurityViolationEvent = 3 [(gogoproto.jsontag) = "security_violation_event" ]; } } @@ -30,4 +43,77 @@ message EventReport { message ActivityEvent { string Message = 1 [(gogoproto.jsontag) = "message" ]; repeated f5.nginx.agent.sdk.common.Dimension Dimensions = 2 [(gogoproto.jsontag) = "dimensions" ]; +} + +// SecurityViolationEvent represents a Security Violation that is emitted by the Agent +message SecurityViolationEvent { + string DateTime = 1 [(gogoproto.jsontag) = "date_time" ]; + string PolicyName = 2 [(gogoproto.jsontag) = "policy_name" ]; + string SupportID = 3 [(gogoproto.jsontag) = "support_id" ]; + + string Outcome = 4 [(gogoproto.jsontag) = "outcome" ]; + string OutcomeReason = 5 [(gogoproto.jsontag) = "outcome_reason" ]; + string BlockingExceptionReason = 6 [(gogoproto.jsontag) = "blocking_exception_reason" ]; + + string Method = 7 [(gogoproto.jsontag) = "method" ]; + string Protocol = 8 [(gogoproto.jsontag) = "protocol" ]; + string XForwardedForHeaderValue = 9 [(gogoproto.jsontag) = "xff_header_value" ]; + + string URI = 10 [(gogoproto.jsontag) = "uri" ]; + string Request = 11 [(gogoproto.jsontag) = "request" ]; + string IsTruncated = 12 [(gogoproto.jsontag) = "is_truncated" ]; + string RequestStatus = 13 [(gogoproto.jsontag) = "request_status" ]; + string ResponseCode = 14 [(gogoproto.jsontag) = "response_code" ]; + + string GeoIP = 15 [(gogoproto.jsontag) = "geo_ip" ]; + string Host = 16 [(gogoproto.jsontag) = "host" ]; + string UnitHostname = 17 [(gogoproto.jsontag) = "unit_hostname" ]; + string SourceHost = 18 [(gogoproto.jsontag) = "source_host" ]; + string VSName = 19 [(gogoproto.jsontag) = "vs_name" ]; + string IPClient = 20 [(gogoproto.jsontag) = "ip_client" ]; + string DestinationPort = 21 [(gogoproto.jsontag) = "destination_port" ]; + string SourcePort = 22 [(gogoproto.jsontag) = "source_port" ]; + + string Violations = 23 [(gogoproto.jsontag) = "violations" ]; + string SubViolations = 24 [(gogoproto.jsontag) = "sub_violations" ]; + string ViolationRating = 25 [(gogoproto.jsontag) = "violation_rating" ]; + + string SigID = 26 [(gogoproto.jsontag) = "sig_id" ]; + string SigNames = 27 [(gogoproto.jsontag) = "sig_names" ]; + string SigSetNames = 28 [(gogoproto.jsontag) = "sig_set_names" ]; + string SigCVEs = 29 [(gogoproto.jsontag) = "sig_cves" ]; + + string ClientClass = 30 [(gogoproto.jsontag) = "client_class" ]; + string ClientApplication = 31 [(gogoproto.jsontag) = "client_application" ]; + string ClientApplicationVersion = 32 [(gogoproto.jsontag) = "client_application_version" ]; + + string Severity = 33 [(gogoproto.jsontag) = "severity" ]; + // NOTE: Severity Label might be deprecated if we have no use for it + string SeverityLabel = 34 [(gogoproto.jsontag) = "severity_label" ]; + string Priority = 35 [(gogoproto.jsontag) = "priority" ]; + + string ThreatCampaignNames = 36 [(gogoproto.jsontag) = "threat_campaign_names" ]; + + string BotAnomalies = 37 [(gogoproto.jsontag) = "bot_anomalies" ]; + string BotCategory = 38 [(gogoproto.jsontag) = "bot_category" ]; + string EnforcedBotAnomalies = 39 [(gogoproto.jsontag) = "enforced_bot_anomalies" ]; + string BotSignatureName = 40 [(gogoproto.jsontag) = "bot_signature_name" ]; + + string ViolationContexts = 41 [(gogoproto.jsontag) = "violation_contexts" ]; + repeated ViolationData ViolationsData = 42 [(gogoproto.jsontag) = "violations_data" ]; +} + +message SignatureData { + string ID = 1 [(gogoproto.jsontag) = "sig_data_id" ]; + string Buffer = 2 [(gogoproto.jsontag) = "sig_data_buffer" ]; + string Offset = 3 [(gogoproto.jsontag) = "sig_data_offset" ]; + string Length = 4 [(gogoproto.jsontag) = "sig_data_length" ]; +} + +message ViolationData { + string Name = 1 [(gogoproto.jsontag) = "violation_data_name" ]; + string Context = 2 [(gogoproto.jsontag) = "violation_data_context" ]; + string ParameterName = 3 [(gogoproto.jsontag) = "violation_data_param_name" ]; + string ParamaterValue = 4 [(gogoproto.jsontag) = "violation_data_param_value" ]; + repeated SignatureData Signatures = 5 [(gogoproto.jsontag) = "violation_data_signatures" ]; } \ No newline at end of file diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go new file mode 100644 index 000000000..654309820 --- /dev/null +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ingest_svc.proto + +package proto + +import ( + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + events "github.com/nginx/agent/sdk/v2/proto/events" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("ingest_svc.proto", fileDescriptor_e87a1d7991134362) } + +var fileDescriptor_e87a1d7991134362 = []byte{ + // 232 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0xcc, 0x4b, 0x4f, + 0x2d, 0x2e, 0x89, 0x2f, 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4a, 0x33, + 0xd5, 0xcb, 0x4b, 0xcf, 0xcc, 0xab, 0xd0, 0x4b, 0x4c, 0x4f, 0xcd, 0x2b, 0xd1, 0x2b, 0x4e, 0xc9, + 0x96, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xab, 0x48, 0x2a, 0x4d, 0xd3, 0x4f, + 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0xcd, 0x4d, 0x2d, 0x29, 0xca, 0x4c, 0x2e, 0x86, + 0x72, 0x85, 0x52, 0xcb, 0x52, 0xf3, 0x4a, 0x8a, 0xf5, 0xc1, 0x14, 0x44, 0xcc, 0x68, 0x27, 0x23, + 0x17, 0x87, 0x27, 0xd8, 0xa2, 0xd4, 0x22, 0xa1, 0x10, 0x2e, 0xe1, 0xe0, 0x92, 0xa2, 0xd4, 0xc4, + 0x5c, 0x5f, 0x88, 0xbe, 0xa0, 0xd4, 0x82, 0xfc, 0xa2, 0x12, 0x21, 0x45, 0x3d, 0x4c, 0x8b, 0xf5, + 0x50, 0x94, 0x48, 0x89, 0xe9, 0x41, 0xdc, 0xa1, 0x07, 0x73, 0x87, 0x9e, 0x2b, 0xc8, 0x1d, 0x4a, + 0x0c, 0x1a, 0x8c, 0x42, 0xe1, 0x5c, 0x82, 0x10, 0x53, 0x5d, 0x41, 0xf6, 0x42, 0xcd, 0x54, 0xc3, + 0x66, 0x26, 0xc4, 0x7d, 0x7a, 0x48, 0xea, 0xf0, 0x19, 0xec, 0x64, 0x7e, 0xe2, 0x91, 0x1c, 0xe3, + 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x46, 0x69, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0x0d, 0xd6, 0x07, 0x1b, 0xac, 0x5f, 0x9c, 0x92, 0xad, 0x5f, + 0x66, 0x04, 0x09, 0x20, 0x6b, 0x88, 0x29, 0x6c, 0x60, 0xca, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0x56, 0x21, 0x22, 0x28, 0x63, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// IngesterClient is the client API for Ingester service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type IngesterClient interface { + // A client-to-server streaming RPC to deliver high volume metrics reports. + StreamMetricsReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamMetricsReportClient, error) + // A client-to-server streaming RPC to deliver high volume event reports. + StreamEventReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamEventReportClient, error) +} + +type ingesterClient struct { + cc *grpc.ClientConn +} + +func NewIngesterClient(cc *grpc.ClientConn) IngesterClient { + return &ingesterClient{cc} +} + +func (c *ingesterClient) StreamMetricsReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamMetricsReportClient, error) { + stream, err := c.cc.NewStream(ctx, &_Ingester_serviceDesc.Streams[0], "/f5.nginx.agent.sdk.Ingester/StreamMetricsReport", opts...) + if err != nil { + return nil, err + } + x := &ingesterStreamMetricsReportClient{stream} + return x, nil +} + +type Ingester_StreamMetricsReportClient interface { + Send(*MetricsReport) error + CloseAndRecv() (*types.Empty, error) + grpc.ClientStream +} + +type ingesterStreamMetricsReportClient struct { + grpc.ClientStream +} + +func (x *ingesterStreamMetricsReportClient) Send(m *MetricsReport) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ingesterStreamMetricsReportClient) CloseAndRecv() (*types.Empty, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(types.Empty) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ingesterClient) StreamEventReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamEventReportClient, error) { + stream, err := c.cc.NewStream(ctx, &_Ingester_serviceDesc.Streams[1], "/f5.nginx.agent.sdk.Ingester/StreamEventReport", opts...) + if err != nil { + return nil, err + } + x := &ingesterStreamEventReportClient{stream} + return x, nil +} + +type Ingester_StreamEventReportClient interface { + Send(*events.EventReport) error + CloseAndRecv() (*types.Empty, error) + grpc.ClientStream +} + +type ingesterStreamEventReportClient struct { + grpc.ClientStream +} + +func (x *ingesterStreamEventReportClient) Send(m *events.EventReport) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ingesterStreamEventReportClient) CloseAndRecv() (*types.Empty, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(types.Empty) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// IngesterServer is the server API for Ingester service. +type IngesterServer interface { + // A client-to-server streaming RPC to deliver high volume metrics reports. + StreamMetricsReport(Ingester_StreamMetricsReportServer) error + // A client-to-server streaming RPC to deliver high volume event reports. + StreamEventReport(Ingester_StreamEventReportServer) error +} + +// UnimplementedIngesterServer can be embedded to have forward compatible implementations. +type UnimplementedIngesterServer struct { +} + +func (*UnimplementedIngesterServer) StreamMetricsReport(srv Ingester_StreamMetricsReportServer) error { + return status.Errorf(codes.Unimplemented, "method StreamMetricsReport not implemented") +} +func (*UnimplementedIngesterServer) StreamEventReport(srv Ingester_StreamEventReportServer) error { + return status.Errorf(codes.Unimplemented, "method StreamEventReport not implemented") +} + +func RegisterIngesterServer(s *grpc.Server, srv IngesterServer) { + s.RegisterService(&_Ingester_serviceDesc, srv) +} + +func _Ingester_StreamMetricsReport_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(IngesterServer).StreamMetricsReport(&ingesterStreamMetricsReportServer{stream}) +} + +type Ingester_StreamMetricsReportServer interface { + SendAndClose(*types.Empty) error + Recv() (*MetricsReport, error) + grpc.ServerStream +} + +type ingesterStreamMetricsReportServer struct { + grpc.ServerStream +} + +func (x *ingesterStreamMetricsReportServer) SendAndClose(m *types.Empty) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ingesterStreamMetricsReportServer) Recv() (*MetricsReport, error) { + m := new(MetricsReport) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Ingester_StreamEventReport_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(IngesterServer).StreamEventReport(&ingesterStreamEventReportServer{stream}) +} + +type Ingester_StreamEventReportServer interface { + SendAndClose(*types.Empty) error + Recv() (*events.EventReport, error) + grpc.ServerStream +} + +type ingesterStreamEventReportServer struct { + grpc.ServerStream +} + +func (x *ingesterStreamEventReportServer) SendAndClose(m *types.Empty) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ingesterStreamEventReportServer) Recv() (*events.EventReport, error) { + m := new(events.EventReport) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Ingester_serviceDesc = grpc.ServiceDesc{ + ServiceName: "f5.nginx.agent.sdk.Ingester", + HandlerType: (*IngesterServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamMetricsReport", + Handler: _Ingester_StreamMetricsReport_Handler, + ClientStreams: true, + }, + { + StreamName: "StreamEventReport", + Handler: _Ingester_StreamEventReport_Handler, + ClientStreams: true, + }, + }, + Metadata: "ingest_svc.proto", +} diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto new file mode 100644 index 000000000..9c362e739 --- /dev/null +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package f5.nginx.agent.sdk; +option go_package = "github.com/nginx/agent/sdk/v2/proto;proto"; + +import "google/protobuf/empty.proto"; +import "metrics.proto"; +import "events/event.proto"; + +// Ingester is responsible for ingesting high volume metrics and events +service Ingester { + // A client-to-server streaming RPC to deliver high volume metrics reports. + rpc StreamMetricsReport(stream MetricsReport) returns (google.protobuf.Empty) {} + + // A client-to-server streaming RPC to deliver high volume event reports. + rpc StreamEventReport(stream f5.nginx.agent.sdk.events.EventReport) returns (google.protobuf.Empty) {} +} diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.pb.go b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.pb.go index fce099c19..698ca65fe 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.pb.go +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.pb.go @@ -28,20 +28,20 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("metrics.svc.proto", fileDescriptor_ece8a4321458910f) } var fileDescriptor_ece8a4321458910f = []byte{ - // 194 bytes of a gzipped FileDescriptorProto + // 199 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcc, 0x4d, 0x2d, 0x29, 0xca, 0x4c, 0x2e, 0xd6, 0x2b, 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4a, 0x33, 0xd5, 0xcb, 0x4b, 0xcf, 0xcc, 0xab, 0xd0, 0x4b, 0x4c, 0x4f, 0xcd, 0x2b, 0xd1, 0x2b, 0x4e, 0xc9, 0x96, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xab, 0x48, 0x2a, 0x4d, 0xd3, - 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0x85, 0x99, 0x01, 0xe6, 0x1a, 0x45, 0x72, + 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0x85, 0x99, 0x01, 0xe6, 0x1a, 0xc5, 0x71, 0xf1, 0xf9, 0x42, 0x04, 0x82, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0x85, 0xdc, 0xb9, 0xd8, 0x82, 0x4b, 0x8a, 0x52, 0x13, 0x73, 0x85, 0x14, 0xf5, 0x30, 0x0d, 0xd7, 0x83, 0xaa, 0x0e, 0x4a, 0x2d, 0xc8, 0x2f, 0x2a, 0x91, 0x12, 0xd3, 0x83, 0xd8, 0xa5, 0x07, 0xb3, 0x4b, 0xcf, 0x15, 0x64, 0x97, - 0x12, 0x83, 0x06, 0xa3, 0x93, 0xf9, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, - 0x24, 0xc7, 0x18, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, - 0x36, 0x53, 0x1f, 0x6c, 0xa6, 0x7e, 0x71, 0x4a, 0xb6, 0x7e, 0x99, 0x11, 0xc4, 0xad, 0xd6, 0x10, - 0x53, 0xd8, 0xc0, 0x94, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x58, 0x03, 0x87, 0xd1, 0xef, 0x00, - 0x00, 0x00, + 0x12, 0x83, 0x06, 0xa3, 0x14, 0x73, 0x07, 0x13, 0xa3, 0x93, 0xf9, 0x89, 0x47, 0x72, 0x8c, 0x17, + 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x18, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, + 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x36, 0x58, 0x1f, 0x6c, 0xb0, 0x7e, 0x71, 0x4a, 0xb6, 0x7e, 0x99, + 0x11, 0xc4, 0xc1, 0xd6, 0x10, 0xa3, 0xd8, 0xc0, 0x94, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x04, + 0x53, 0x50, 0x03, 0xf4, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -55,6 +55,8 @@ const _ = grpc.SupportPackageIsVersion4 // MetricsServiceClient is the client API for MetricsService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +// +// Deprecated: Do not use. type MetricsServiceClient interface { // A client-to-server streaming RPC to deliver high volume metrics reports. Stream(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamClient, error) @@ -64,6 +66,7 @@ type metricsServiceClient struct { cc *grpc.ClientConn } +// Deprecated: Do not use. func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient { return &metricsServiceClient{cc} } @@ -103,11 +106,14 @@ func (x *metricsServiceStreamClient) CloseAndRecv() (*types.Empty, error) { } // MetricsServiceServer is the server API for MetricsService service. +// +// Deprecated: Do not use. type MetricsServiceServer interface { // A client-to-server streaming RPC to deliver high volume metrics reports. Stream(MetricsService_StreamServer) error } +// Deprecated: Do not use. // UnimplementedMetricsServiceServer can be embedded to have forward compatible implementations. type UnimplementedMetricsServiceServer struct { } @@ -116,6 +122,7 @@ func (*UnimplementedMetricsServiceServer) Stream(srv MetricsService_StreamServer return status.Errorf(codes.Unimplemented, "method Stream not implemented") } +// Deprecated: Do not use. func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) { s.RegisterService(&_MetricsService_serviceDesc, srv) } diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.proto b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.proto index 6da52b29d..62488ac44 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.proto +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.proto @@ -7,6 +7,7 @@ import "metrics.proto"; // Interface exported by the server. service MetricsService { + option deprecated = true; // A client-to-server streaming RPC to deliver high volume metrics reports. rpc Stream(stream MetricsReport) returns (google.protobuf.Empty) {} diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/events.go b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/events.go index 9d8b38c8e..e0ceb89c0 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/events.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/plugins/events.go @@ -38,8 +38,9 @@ const ( AGENT_EVENT_TYPE = "Agent" // Categories - STATUS_CATEGORY = "Status" - CONFIG_CATEGORY = "Config" + STATUS_CATEGORY = "Status" + CONFIG_CATEGORY = "Config" + APP_PROTECT_CATEGORY = "AppProtect" // Event Levels INFO_EVENT_LEVEL = "INFO" diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.pb.go b/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.pb.go index 39b2e1760..00c7c1fb3 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.pb.go +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.pb.go @@ -124,6 +124,7 @@ type Event struct { Metadata *Metadata `protobuf:"bytes,1,opt,name=Metadata,proto3" json:"metadata"` // Types that are valid to be assigned to Data: // *Event_ActivityEvent + // *Event_SecurityViolationEvent Data isEvent_Data `protobuf_oneof:"data"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -172,8 +173,12 @@ type isEvent_Data interface { type Event_ActivityEvent struct { ActivityEvent *ActivityEvent `protobuf:"bytes,2,opt,name=ActivityEvent,proto3,oneof" json:"activity_event"` } +type Event_SecurityViolationEvent struct { + SecurityViolationEvent *SecurityViolationEvent `protobuf:"bytes,3,opt,name=SecurityViolationEvent,proto3,oneof" json:"security_violation_event"` +} -func (*Event_ActivityEvent) isEvent_Data() {} +func (*Event_ActivityEvent) isEvent_Data() {} +func (*Event_SecurityViolationEvent) isEvent_Data() {} func (m *Event) GetData() isEvent_Data { if m != nil { @@ -196,10 +201,18 @@ func (m *Event) GetActivityEvent() *ActivityEvent { return nil } +func (m *Event) GetSecurityViolationEvent() *SecurityViolationEvent { + if x, ok := m.GetData().(*Event_SecurityViolationEvent); ok { + return x.SecurityViolationEvent + } + return nil +} + // XXX_OneofWrappers is for the internal use of the proto package. func (*Event) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Event_ActivityEvent)(nil), + (*Event_SecurityViolationEvent)(nil), } } @@ -305,450 +318,3591 @@ func (m *ActivityEvent) GetDimensions() []*common.Dimension { return nil } -func init() { - proto.RegisterType((*Metadata)(nil), "f5.nginx.agent.sdk.events.Metadata") - proto.RegisterType((*Event)(nil), "f5.nginx.agent.sdk.events.Event") - proto.RegisterType((*EventReport)(nil), "f5.nginx.agent.sdk.events.EventReport") - proto.RegisterType((*ActivityEvent)(nil), "f5.nginx.agent.sdk.events.ActivityEvent") +// SecurityViolationEvent represents a Security Violation that is emitted by the Agent +type SecurityViolationEvent struct { + DateTime string `protobuf:"bytes,1,opt,name=DateTime,proto3" json:"date_time"` + PolicyName string `protobuf:"bytes,2,opt,name=PolicyName,proto3" json:"policy_name"` + SupportID string `protobuf:"bytes,3,opt,name=SupportID,proto3" json:"support_id"` + Outcome string `protobuf:"bytes,4,opt,name=Outcome,proto3" json:"outcome"` + OutcomeReason string `protobuf:"bytes,5,opt,name=OutcomeReason,proto3" json:"outcome_reason"` + BlockingExceptionReason string `protobuf:"bytes,6,opt,name=BlockingExceptionReason,proto3" json:"blocking_exception_reason"` + Method string `protobuf:"bytes,7,opt,name=Method,proto3" json:"method"` + Protocol string `protobuf:"bytes,8,opt,name=Protocol,proto3" json:"protocol"` + XForwardedForHeaderValue string `protobuf:"bytes,9,opt,name=XForwardedForHeaderValue,proto3" json:"xff_header_value"` + URI string `protobuf:"bytes,10,opt,name=URI,proto3" json:"uri"` + Request string `protobuf:"bytes,11,opt,name=Request,proto3" json:"request"` + IsTruncated string `protobuf:"bytes,12,opt,name=IsTruncated,proto3" json:"is_truncated"` + RequestStatus string `protobuf:"bytes,13,opt,name=RequestStatus,proto3" json:"request_status"` + ResponseCode string `protobuf:"bytes,14,opt,name=ResponseCode,proto3" json:"response_code"` + GeoIP string `protobuf:"bytes,15,opt,name=GeoIP,proto3" json:"geo_ip"` + Host string `protobuf:"bytes,16,opt,name=Host,proto3" json:"host"` + UnitHostname string `protobuf:"bytes,17,opt,name=UnitHostname,proto3" json:"unit_hostname"` + SourceHost string `protobuf:"bytes,18,opt,name=SourceHost,proto3" json:"source_host"` + VSName string `protobuf:"bytes,19,opt,name=VSName,proto3" json:"vs_name"` + IPClient string `protobuf:"bytes,20,opt,name=IPClient,proto3" json:"ip_client"` + DestinationPort string `protobuf:"bytes,21,opt,name=DestinationPort,proto3" json:"destination_port"` + SourcePort string `protobuf:"bytes,22,opt,name=SourcePort,proto3" json:"source_port"` + Violations string `protobuf:"bytes,23,opt,name=Violations,proto3" json:"violations"` + SubViolations string `protobuf:"bytes,24,opt,name=SubViolations,proto3" json:"sub_violations"` + ViolationRating string `protobuf:"bytes,25,opt,name=ViolationRating,proto3" json:"violation_rating"` + SigID string `protobuf:"bytes,26,opt,name=SigID,proto3" json:"sig_id"` + SigNames string `protobuf:"bytes,27,opt,name=SigNames,proto3" json:"sig_names"` + SigSetNames string `protobuf:"bytes,28,opt,name=SigSetNames,proto3" json:"sig_set_names"` + SigCVEs string `protobuf:"bytes,29,opt,name=SigCVEs,proto3" json:"sig_cves"` + ClientClass string `protobuf:"bytes,30,opt,name=ClientClass,proto3" json:"client_class"` + ClientApplication string `protobuf:"bytes,31,opt,name=ClientApplication,proto3" json:"client_application"` + ClientApplicationVersion string `protobuf:"bytes,32,opt,name=ClientApplicationVersion,proto3" json:"client_application_version"` + Severity string `protobuf:"bytes,33,opt,name=Severity,proto3" json:"severity"` + // NOTE: Severity Label might be deprecated if we have no use for it + SeverityLabel string `protobuf:"bytes,34,opt,name=SeverityLabel,proto3" json:"severity_label"` + Priority string `protobuf:"bytes,35,opt,name=Priority,proto3" json:"priority"` + ThreatCampaignNames string `protobuf:"bytes,36,opt,name=ThreatCampaignNames,proto3" json:"threat_campaign_names"` + BotAnomalies string `protobuf:"bytes,37,opt,name=BotAnomalies,proto3" json:"bot_anomalies"` + BotCategory string `protobuf:"bytes,38,opt,name=BotCategory,proto3" json:"bot_category"` + EnforcedBotAnomalies string `protobuf:"bytes,39,opt,name=EnforcedBotAnomalies,proto3" json:"enforced_bot_anomalies"` + BotSignatureName string `protobuf:"bytes,40,opt,name=BotSignatureName,proto3" json:"bot_signature_name"` + ViolationContexts string `protobuf:"bytes,41,opt,name=ViolationContexts,proto3" json:"violation_contexts"` + ViolationsData []*ViolationData `protobuf:"bytes,42,rep,name=ViolationsData,proto3" json:"violations_data"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } - -var fileDescriptor_2d17a9d3f0ddf27e = []byte{ - // 512 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcf, 0x6e, 0xd3, 0x4c, - 0x14, 0xc5, 0x3f, 0xa7, 0xa9, 0x93, 0x5c, 0x7f, 0x29, 0xd2, 0xb0, 0x31, 0x11, 0x8a, 0xa3, 0x00, - 0x52, 0x56, 0xb6, 0x14, 0x84, 0x84, 0xc4, 0x8a, 0x34, 0x08, 0x2a, 0x91, 0xcd, 0x90, 0x6e, 0xd8, - 0x44, 0x4e, 0x3c, 0x35, 0xa3, 0xda, 0x1e, 0xcb, 0x1e, 0x47, 0xe4, 0x1d, 0x78, 0x2c, 0x16, 0x5d, - 0xf2, 0x04, 0x16, 0xca, 0xd2, 0x4f, 0x81, 0x7c, 0xc7, 0x7f, 0x1a, 0x44, 0xbb, 0xb2, 0xe6, 0xdc, - 0xdf, 0x9c, 0x99, 0x73, 0xe7, 0x1a, 0x0c, 0xb6, 0x67, 0x91, 0xb4, 0xe3, 0x44, 0x48, 0x41, 0x9e, - 0xdd, 0xbc, 0xb1, 0x23, 0x9f, 0x47, 0xdf, 0x6d, 0xd7, 0x2f, 0xd5, 0xd4, 0xbb, 0xb5, 0xb1, 0x9e, - 0x8e, 0xc0, 0x17, 0xbe, 0x50, 0xd8, 0xc8, 0xf2, 0x85, 0xf0, 0x03, 0xe6, 0xe0, 0x6a, 0x9b, 0xdd, - 0x38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xf0, 0x5b, 0x1d, - 0xb9, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x99, 0xea, 0x62, 0xfe, 0xbc, 0x03, 0x00, 0x00, +func (m *SecurityViolationEvent) Reset() { *m = SecurityViolationEvent{} } +func (m *SecurityViolationEvent) String() string { return proto.CompactTextString(m) } +func (*SecurityViolationEvent) ProtoMessage() {} +func (*SecurityViolationEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{4} } - -func (m *Metadata) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SecurityViolationEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SecurityViolationEvent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil } - return dAtA[:n], nil } - -func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_SecurityViolationEvent.Merge(m, src) +} +func (m *SecurityViolationEvent) XXX_Size() int { + return m.Size() +} +func (m *SecurityViolationEvent) XXX_DiscardUnknown() { + xxx_messageInfo_SecurityViolationEvent.DiscardUnknown(m) } -func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Category) > 0 { - i -= len(m.Category) - copy(dAtA[i:], m.Category) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Category))) - i-- - dAtA[i] = 0x3a - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0x32 +var xxx_messageInfo_SecurityViolationEvent proto.InternalMessageInfo + +func (m *SecurityViolationEvent) GetDateTime() string { + if m != nil { + return m.DateTime } - if len(m.EventLevel) > 0 { - i -= len(m.EventLevel) - copy(dAtA[i:], m.EventLevel) - i = encodeVarintEvent(dAtA, i, uint64(len(m.EventLevel))) - i-- - dAtA[i] = 0x2a + return "" +} + +func (m *SecurityViolationEvent) GetPolicyName() string { + if m != nil { + return m.PolicyName } - if m.Timestamp != nil { - { - size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 + return "" +} + +func (m *SecurityViolationEvent) GetSupportID() string { + if m != nil { + return m.SupportID } - if len(m.CorrelationID) > 0 { - i -= len(m.CorrelationID) - copy(dAtA[i:], m.CorrelationID) - i = encodeVarintEvent(dAtA, i, uint64(len(m.CorrelationID))) - i-- - dAtA[i] = 0x1a + return "" +} + +func (m *SecurityViolationEvent) GetOutcome() string { + if m != nil { + return m.Outcome } - if len(m.UUID) > 0 { - i -= len(m.UUID) - copy(dAtA[i:], m.UUID) - i = encodeVarintEvent(dAtA, i, uint64(len(m.UUID))) - i-- - dAtA[i] = 0x12 + return "" +} + +func (m *SecurityViolationEvent) GetOutcomeReason() string { + if m != nil { + return m.OutcomeReason } - if len(m.Module) > 0 { - i -= len(m.Module) - copy(dAtA[i:], m.Module) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Module))) - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetBlockingExceptionReason() string { + if m != nil { + return m.BlockingExceptionReason } - return len(dAtA) - i, nil + return "" } -func (m *Event) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) GetMethod() string { + if m != nil { + return m.Method } - return dAtA[:n], nil + return "" } -func (m *Event) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" } -func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) +func (m *SecurityViolationEvent) GetXForwardedForHeaderValue() string { + if m != nil { + return m.XForwardedForHeaderValue } - if m.Data != nil { - { - size := m.Data.Size() - i -= size - if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + return "" +} + +func (m *SecurityViolationEvent) GetURI() string { + if m != nil { + return m.URI } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetRequest() string { + if m != nil { + return m.Request } - return len(dAtA) - i, nil + return "" } -func (m *Event_ActivityEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetIsTruncated() string { + if m != nil { + return m.IsTruncated + } + return "" } -func (m *Event_ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ActivityEvent != nil { - { - size, err := m.ActivityEvent.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 +func (m *SecurityViolationEvent) GetRequestStatus() string { + if m != nil { + return m.RequestStatus } - return len(dAtA) - i, nil + return "" } -func (m *EventReport) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err + +func (m *SecurityViolationEvent) GetResponseCode() string { + if m != nil { + return m.ResponseCode } - return dAtA[:n], nil + return "" } -func (m *EventReport) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetGeoIP() string { + if m != nil { + return m.GeoIP + } + return "" } -func (m *EventReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) +func (m *SecurityViolationEvent) GetHost() string { + if m != nil { + return m.Host } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } + return "" +} + +func (m *SecurityViolationEvent) GetUnitHostname() string { + if m != nil { + return m.UnitHostname } - return len(dAtA) - i, nil + return "" } -func (m *ActivityEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func (m *SecurityViolationEvent) GetSourceHost() string { + if m != nil { + return m.SourceHost } - return dAtA[:n], nil + return "" } -func (m *ActivityEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *SecurityViolationEvent) GetVSName() string { + if m != nil { + return m.VSName + } + return "" } -func (m *ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Dimensions) > 0 { - for iNdEx := len(m.Dimensions) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Dimensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } +func (m *SecurityViolationEvent) GetIPClient() string { + if m != nil { + return m.IPClient } - if len(m.Message) > 0 { - i -= len(m.Message) - copy(dAtA[i:], m.Message) - i = encodeVarintEvent(dAtA, i, uint64(len(m.Message))) - i-- - dAtA[i] = 0xa + return "" +} + +func (m *SecurityViolationEvent) GetDestinationPort() string { + if m != nil { + return m.DestinationPort } - return len(dAtA) - i, nil + return "" } -func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *SecurityViolationEvent) GetSourcePort() string { + if m != nil { + return m.SourcePort } - dAtA[offset] = uint8(v) - return base + return "" } -func (m *Metadata) Size() (n int) { - if m == nil { - return 0 + +func (m *SecurityViolationEvent) GetViolations() string { + if m != nil { + return m.Violations } - var l int - _ = l - l = len(m.Module) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSubViolations() string { + if m != nil { + return m.SubViolations } - l = len(m.UUID) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetViolationRating() string { + if m != nil { + return m.ViolationRating } - l = len(m.CorrelationID) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigID() string { + if m != nil { + return m.SigID } - if m.Timestamp != nil { - l = m.Timestamp.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigNames() string { + if m != nil { + return m.SigNames } - l = len(m.EventLevel) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigSetNames() string { + if m != nil { + return m.SigSetNames } - l = len(m.Type) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSigCVEs() string { + if m != nil { + return m.SigCVEs } - l = len(m.Category) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetClientClass() string { + if m != nil { + return m.ClientClass } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetClientApplication() string { + if m != nil { + return m.ClientApplication } - return n + return "" } -func (m *Event) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetClientApplicationVersion() string { + if m != nil { + return m.ClientApplicationVersion } - var l int - _ = l - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetSeverity() string { + if m != nil { + return m.Severity } - if m.Data != nil { - n += m.Data.Size() + return "" +} + +func (m *SecurityViolationEvent) GetSeverityLabel() string { + if m != nil { + return m.SeverityLabel } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetPriority() string { + if m != nil { + return m.Priority } - return n + return "" } -func (m *Event_ActivityEvent) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetThreatCampaignNames() string { + if m != nil { + return m.ThreatCampaignNames } - var l int - _ = l - if m.ActivityEvent != nil { - l = m.ActivityEvent.Size() - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetBotAnomalies() string { + if m != nil { + return m.BotAnomalies } - return n + return "" } -func (m *EventReport) Size() (n int) { - if m == nil { - return 0 + +func (m *SecurityViolationEvent) GetBotCategory() string { + if m != nil { + return m.BotCategory } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovEvent(uint64(l)) - } + return "" +} + +func (m *SecurityViolationEvent) GetEnforcedBotAnomalies() string { + if m != nil { + return m.EnforcedBotAnomalies } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + return "" +} + +func (m *SecurityViolationEvent) GetBotSignatureName() string { + if m != nil { + return m.BotSignatureName } - return n + return "" } -func (m *ActivityEvent) Size() (n int) { - if m == nil { - return 0 +func (m *SecurityViolationEvent) GetViolationContexts() string { + if m != nil { + return m.ViolationContexts } - var l int - _ = l - l = len(m.Message) - if l > 0 { - n += 1 + l + sovEvent(uint64(l)) + return "" +} + +func (m *SecurityViolationEvent) GetViolationsData() []*ViolationData { + if m != nil { + return m.ViolationsData } - if len(m.Dimensions) > 0 { - for _, e := range m.Dimensions { - l = e.Size() - n += 1 + l + sovEvent(uint64(l)) + return nil +} + +type SignatureData struct { + ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"sig_data_id"` + Buffer string `protobuf:"bytes,2,opt,name=Buffer,proto3" json:"sig_data_buffer"` + Offset string `protobuf:"bytes,3,opt,name=Offset,proto3" json:"sig_data_offset"` + Length string `protobuf:"bytes,4,opt,name=Length,proto3" json:"sig_data_length"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignatureData) Reset() { *m = SignatureData{} } +func (m *SignatureData) String() string { return proto.CompactTextString(m) } +func (*SignatureData) ProtoMessage() {} +func (*SignatureData) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{5} +} +func (m *SignatureData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SignatureData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SignatureData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } + return b[:n], nil } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) +} +func (m *SignatureData) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignatureData.Merge(m, src) +} +func (m *SignatureData) XXX_Size() int { + return m.Size() +} +func (m *SignatureData) XXX_DiscardUnknown() { + xxx_messageInfo_SignatureData.DiscardUnknown(m) +} + +var xxx_messageInfo_SignatureData proto.InternalMessageInfo + +func (m *SignatureData) GetID() string { + if m != nil { + return m.ID } - return n + return "" } -func sovEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 +func (m *SignatureData) GetBuffer() string { + if m != nil { + return m.Buffer + } + return "" } -func sozEvent(x uint64) (n int) { - return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + +func (m *SignatureData) GetOffset() string { + if m != nil { + return m.Offset + } + return "" } -func (m *Metadata) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + +func (m *SignatureData) GetLength() string { + if m != nil { + return m.Length + } + return "" +} + +type ViolationData struct { + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"violation_data_name"` + Context string `protobuf:"bytes,2,opt,name=Context,proto3" json:"violation_data_context"` + ParameterName string `protobuf:"bytes,3,opt,name=ParameterName,proto3" json:"violation_data_param_name"` + ParamaterValue string `protobuf:"bytes,4,opt,name=ParamaterValue,proto3" json:"violation_data_param_value"` + Signatures []*SignatureData `protobuf:"bytes,5,rep,name=Signatures,proto3" json:"violation_data_signatures"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ViolationData) Reset() { *m = ViolationData{} } +func (m *ViolationData) String() string { return proto.CompactTextString(m) } +func (*ViolationData) ProtoMessage() {} +func (*ViolationData) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{6} +} +func (m *ViolationData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ViolationData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ViolationData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err } - if fieldNum <= 0 { - return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + return b[:n], nil + } +} +func (m *ViolationData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ViolationData.Merge(m, src) +} +func (m *ViolationData) XXX_Size() int { + return m.Size() +} +func (m *ViolationData) XXX_DiscardUnknown() { + xxx_messageInfo_ViolationData.DiscardUnknown(m) +} + +var xxx_messageInfo_ViolationData proto.InternalMessageInfo + +func (m *ViolationData) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ViolationData) GetContext() string { + if m != nil { + return m.Context + } + return "" +} + +func (m *ViolationData) GetParameterName() string { + if m != nil { + return m.ParameterName + } + return "" +} + +func (m *ViolationData) GetParamaterValue() string { + if m != nil { + return m.ParamaterValue + } + return "" +} + +func (m *ViolationData) GetSignatures() []*SignatureData { + if m != nil { + return m.Signatures + } + return nil +} + +func init() { + proto.RegisterType((*Metadata)(nil), "f5.nginx.agent.sdk.events.Metadata") + proto.RegisterType((*Event)(nil), "f5.nginx.agent.sdk.events.Event") + proto.RegisterType((*EventReport)(nil), "f5.nginx.agent.sdk.events.EventReport") + proto.RegisterType((*ActivityEvent)(nil), "f5.nginx.agent.sdk.events.ActivityEvent") + proto.RegisterType((*SecurityViolationEvent)(nil), "f5.nginx.agent.sdk.events.SecurityViolationEvent") + proto.RegisterType((*SignatureData)(nil), "f5.nginx.agent.sdk.events.SignatureData") + proto.RegisterType((*ViolationData)(nil), "f5.nginx.agent.sdk.events.ViolationData") +} + +func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } + +var fileDescriptor_2d17a9d3f0ddf27e = []byte{ + // 1620 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x57, 0xdd, 0x6e, 0xdb, 0xc8, + 0x15, 0xae, 0x6c, 0xc7, 0x3f, 0xa3, 0xc8, 0x49, 0xc6, 0xd9, 0x64, 0xec, 0x66, 0x4d, 0x57, 0xd9, + 0xdd, 0x7a, 0xbb, 0x85, 0x84, 0x7a, 0xbb, 0x40, 0x81, 0x02, 0x05, 0x22, 0x29, 0xd9, 0x08, 0x4d, + 0x76, 0x8d, 0x91, 0xe3, 0x16, 0x7b, 0x43, 0x50, 0xe4, 0x88, 0x1e, 0x44, 0xe2, 0xa8, 0x9c, 0xa1, + 0x1a, 0x3f, 0x42, 0x81, 0xbe, 0x4f, 0x5f, 0x61, 0x2f, 0xf3, 0x04, 0x44, 0x91, 0xab, 0x82, 0xef, + 0x50, 0xa0, 0x98, 0x33, 0x43, 0x0e, 0xe9, 0xbf, 0x5e, 0x45, 0x3c, 0xdf, 0xf7, 0x9d, 0x33, 0x73, + 0xfe, 0x3c, 0x41, 0x6d, 0xb6, 0x62, 0x89, 0xea, 0x2d, 0x53, 0xa1, 0x04, 0xde, 0x9f, 0x7d, 0xd7, + 0x4b, 0x62, 0x9e, 0x7c, 0xe8, 0x05, 0xb1, 0xb6, 0xca, 0xe8, 0x7d, 0x0f, 0x70, 0x79, 0x80, 0x62, + 0x11, 0x0b, 0x43, 0x3b, 0xf0, 0x62, 0x21, 0xe2, 0x39, 0xeb, 0xc3, 0xd7, 0x34, 0x9b, 0xf5, 0x15, + 0x5f, 0x30, 0xa9, 0x82, 0xc5, 0xd2, 0x12, 0xf6, 0x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, + 0x33, 0x49, 0xbe, 0x74, 0xed, 0x30, 0x15, 0xca, 0x0f, 0x4a, 0x80, 0x36, 0x68, 0xba, 0xce, 0x03, + 0xa1, 0xaa, 0xe7, 0xde, 0x57, 0xae, 0xce, 0x5a, 0x55, 0x3d, 0xf9, 0xea, 0x24, 0xfc, 0x03, 0x7a, + 0xfc, 0x32, 0x99, 0x89, 0x34, 0x64, 0x51, 0x23, 0xe4, 0xaf, 0x41, 0x7c, 0x50, 0xe4, 0xde, 0x13, + 0x66, 0x71, 0xbf, 0x19, 0xfb, 0x46, 0x1d, 0x1e, 0xa0, 0x87, 0x03, 0xa1, 0x26, 0x3c, 0x4e, 0x02, + 0x95, 0xa5, 0x0c, 0x56, 0xd1, 0xb1, 0x6b, 0x1b, 0xed, 0x42, 0x96, 0xa0, 0xd9, 0x4a, 0xd7, 0xf8, + 0xba, 0xf7, 0xaa, 0x61, 0x1b, 0x8a, 0x44, 0xb1, 0x0f, 0x4a, 0x92, 0xaf, 0x9d, 0x13, 0x37, 0x9b, + 0xa1, 0x45, 0xe9, 0x75, 0x01, 0x66, 0x68, 0xd7, 0x4d, 0xfb, 0x48, 0xbf, 0x65, 0x7f, 0x03, 0x4f, + 0x9e, 0xbb, 0xde, 0x9d, 0x95, 0x40, 0xf3, 0x07, 0x7b, 0x45, 0xee, 0x3d, 0x70, 0x0b, 0xc4, 0x87, + 0x77, 0xed, 0x15, 0xa7, 0xdd, 0x7f, 0xb5, 0x50, 0xa7, 0x3a, 0xbe, 0xb6, 0x60, 0x0f, 0xad, 0x8d, + 0x47, 0xf6, 0xc1, 0x63, 0x76, 0x1d, 0x8f, 0x41, 0xab, 0x57, 0xc3, 0xda, 0x78, 0x84, 0xbf, 0x41, + 0x9b, 0x83, 0x6c, 0x36, 0x63, 0xa9, 0x7d, 0xe8, 0x40, 0x9c, 0x8a, 0x34, 0x05, 0x88, 0x5a, 0x8a, + 0x26, 0xff, 0x38, 0x9b, 0x49, 0xa6, 0xec, 0x2b, 0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30, 0x39, 0xb9, 0x5d, + 0x6d, 0x0f, 0x00, 0x00, +} + +func (m *Metadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Metadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Category) > 0 { + i -= len(m.Category) + copy(dAtA[i:], m.Category) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Category))) + i-- + dAtA[i] = 0x3a + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0x32 + } + if len(m.EventLevel) > 0 { + i -= len(m.EventLevel) + copy(dAtA[i:], m.EventLevel) + i = encodeVarintEvent(dAtA, i, uint64(len(m.EventLevel))) + i-- + dAtA[i] = 0x2a + } + if m.Timestamp != nil { + { + size, err := m.Timestamp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) } - switch fieldNum { - case 1: + i-- + dAtA[i] = 0x22 + } + if len(m.CorrelationID) > 0 { + i -= len(m.CorrelationID) + copy(dAtA[i:], m.CorrelationID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.CorrelationID))) + i-- + dAtA[i] = 0x1a + } + if len(m.UUID) > 0 { + i -= len(m.UUID) + copy(dAtA[i:], m.UUID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.UUID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Module) > 0 { + i -= len(m.Module) + copy(dAtA[i:], m.Module) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Module))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Event) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Event) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Data != nil { + { + size := m.Data.Size() + i -= size + if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Event_ActivityEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event_ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ActivityEvent != nil { + { + size, err := m.ActivityEvent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *Event_SecurityViolationEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Event_SecurityViolationEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.SecurityViolationEvent != nil { + { + size, err := m.SecurityViolationEvent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *EventReport) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventReport) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventReport) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ActivityEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ActivityEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ActivityEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Dimensions) > 0 { + for iNdEx := len(m.Dimensions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Dimensions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SecurityViolationEvent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SecurityViolationEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SecurityViolationEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ViolationsData) > 0 { + for iNdEx := len(m.ViolationsData) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ViolationsData[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xd2 + } + } + if len(m.ViolationContexts) > 0 { + i -= len(m.ViolationContexts) + copy(dAtA[i:], m.ViolationContexts) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ViolationContexts))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xca + } + if len(m.BotSignatureName) > 0 { + i -= len(m.BotSignatureName) + copy(dAtA[i:], m.BotSignatureName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotSignatureName))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xc2 + } + if len(m.EnforcedBotAnomalies) > 0 { + i -= len(m.EnforcedBotAnomalies) + copy(dAtA[i:], m.EnforcedBotAnomalies) + i = encodeVarintEvent(dAtA, i, uint64(len(m.EnforcedBotAnomalies))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xba + } + if len(m.BotCategory) > 0 { + i -= len(m.BotCategory) + copy(dAtA[i:], m.BotCategory) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotCategory))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xb2 + } + if len(m.BotAnomalies) > 0 { + i -= len(m.BotAnomalies) + copy(dAtA[i:], m.BotAnomalies) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BotAnomalies))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xaa + } + if len(m.ThreatCampaignNames) > 0 { + i -= len(m.ThreatCampaignNames) + copy(dAtA[i:], m.ThreatCampaignNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ThreatCampaignNames))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xa2 + } + if len(m.Priority) > 0 { + i -= len(m.Priority) + copy(dAtA[i:], m.Priority) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Priority))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x9a + } + if len(m.SeverityLabel) > 0 { + i -= len(m.SeverityLabel) + copy(dAtA[i:], m.SeverityLabel) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SeverityLabel))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x92 + } + if len(m.Severity) > 0 { + i -= len(m.Severity) + copy(dAtA[i:], m.Severity) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Severity))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x8a + } + if len(m.ClientApplicationVersion) > 0 { + i -= len(m.ClientApplicationVersion) + copy(dAtA[i:], m.ClientApplicationVersion) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientApplicationVersion))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0x82 + } + if len(m.ClientApplication) > 0 { + i -= len(m.ClientApplication) + copy(dAtA[i:], m.ClientApplication) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientApplication))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xfa + } + if len(m.ClientClass) > 0 { + i -= len(m.ClientClass) + copy(dAtA[i:], m.ClientClass) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ClientClass))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xf2 + } + if len(m.SigCVEs) > 0 { + i -= len(m.SigCVEs) + copy(dAtA[i:], m.SigCVEs) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigCVEs))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xea + } + if len(m.SigSetNames) > 0 { + i -= len(m.SigSetNames) + copy(dAtA[i:], m.SigSetNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigSetNames))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xe2 + } + if len(m.SigNames) > 0 { + i -= len(m.SigNames) + copy(dAtA[i:], m.SigNames) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigNames))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xda + } + if len(m.SigID) > 0 { + i -= len(m.SigID) + copy(dAtA[i:], m.SigID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SigID))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xd2 + } + if len(m.ViolationRating) > 0 { + i -= len(m.ViolationRating) + copy(dAtA[i:], m.ViolationRating) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ViolationRating))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xca + } + if len(m.SubViolations) > 0 { + i -= len(m.SubViolations) + copy(dAtA[i:], m.SubViolations) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SubViolations))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(m.Violations) > 0 { + i -= len(m.Violations) + copy(dAtA[i:], m.Violations) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Violations))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.SourcePort) > 0 { + i -= len(m.SourcePort) + copy(dAtA[i:], m.SourcePort) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourcePort))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if len(m.DestinationPort) > 0 { + i -= len(m.DestinationPort) + copy(dAtA[i:], m.DestinationPort) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DestinationPort))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + if len(m.IPClient) > 0 { + i -= len(m.IPClient) + copy(dAtA[i:], m.IPClient) + i = encodeVarintEvent(dAtA, i, uint64(len(m.IPClient))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if len(m.VSName) > 0 { + i -= len(m.VSName) + copy(dAtA[i:], m.VSName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.VSName))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if len(m.SourceHost) > 0 { + i -= len(m.SourceHost) + copy(dAtA[i:], m.SourceHost) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SourceHost))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.UnitHostname) > 0 { + i -= len(m.UnitHostname) + copy(dAtA[i:], m.UnitHostname) + i = encodeVarintEvent(dAtA, i, uint64(len(m.UnitHostname))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if len(m.GeoIP) > 0 { + i -= len(m.GeoIP) + copy(dAtA[i:], m.GeoIP) + i = encodeVarintEvent(dAtA, i, uint64(len(m.GeoIP))) + i-- + dAtA[i] = 0x7a + } + if len(m.ResponseCode) > 0 { + i -= len(m.ResponseCode) + copy(dAtA[i:], m.ResponseCode) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ResponseCode))) + i-- + dAtA[i] = 0x72 + } + if len(m.RequestStatus) > 0 { + i -= len(m.RequestStatus) + copy(dAtA[i:], m.RequestStatus) + i = encodeVarintEvent(dAtA, i, uint64(len(m.RequestStatus))) + i-- + dAtA[i] = 0x6a + } + if len(m.IsTruncated) > 0 { + i -= len(m.IsTruncated) + copy(dAtA[i:], m.IsTruncated) + i = encodeVarintEvent(dAtA, i, uint64(len(m.IsTruncated))) + i-- + dAtA[i] = 0x62 + } + if len(m.Request) > 0 { + i -= len(m.Request) + copy(dAtA[i:], m.Request) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Request))) + i-- + dAtA[i] = 0x5a + } + if len(m.URI) > 0 { + i -= len(m.URI) + copy(dAtA[i:], m.URI) + i = encodeVarintEvent(dAtA, i, uint64(len(m.URI))) + i-- + dAtA[i] = 0x52 + } + if len(m.XForwardedForHeaderValue) > 0 { + i -= len(m.XForwardedForHeaderValue) + copy(dAtA[i:], m.XForwardedForHeaderValue) + i = encodeVarintEvent(dAtA, i, uint64(len(m.XForwardedForHeaderValue))) + i-- + dAtA[i] = 0x4a + } + if len(m.Protocol) > 0 { + i -= len(m.Protocol) + copy(dAtA[i:], m.Protocol) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Protocol))) + i-- + dAtA[i] = 0x42 + } + if len(m.Method) > 0 { + i -= len(m.Method) + copy(dAtA[i:], m.Method) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Method))) + i-- + dAtA[i] = 0x3a + } + if len(m.BlockingExceptionReason) > 0 { + i -= len(m.BlockingExceptionReason) + copy(dAtA[i:], m.BlockingExceptionReason) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BlockingExceptionReason))) + i-- + dAtA[i] = 0x32 + } + if len(m.OutcomeReason) > 0 { + i -= len(m.OutcomeReason) + copy(dAtA[i:], m.OutcomeReason) + i = encodeVarintEvent(dAtA, i, uint64(len(m.OutcomeReason))) + i-- + dAtA[i] = 0x2a + } + if len(m.Outcome) > 0 { + i -= len(m.Outcome) + copy(dAtA[i:], m.Outcome) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Outcome))) + i-- + dAtA[i] = 0x22 + } + if len(m.SupportID) > 0 { + i -= len(m.SupportID) + copy(dAtA[i:], m.SupportID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SupportID))) + i-- + dAtA[i] = 0x1a + } + if len(m.PolicyName) > 0 { + i -= len(m.PolicyName) + copy(dAtA[i:], m.PolicyName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.PolicyName))) + i-- + dAtA[i] = 0x12 + } + if len(m.DateTime) > 0 { + i -= len(m.DateTime) + copy(dAtA[i:], m.DateTime) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DateTime))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SignatureData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SignatureData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Length) > 0 { + i -= len(m.Length) + copy(dAtA[i:], m.Length) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Length))) + i-- + dAtA[i] = 0x22 + } + if len(m.Offset) > 0 { + i -= len(m.Offset) + copy(dAtA[i:], m.Offset) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Offset))) + i-- + dAtA[i] = 0x1a + } + if len(m.Buffer) > 0 { + i -= len(m.Buffer) + copy(dAtA[i:], m.Buffer) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Buffer))) + i-- + dAtA[i] = 0x12 + } + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ViolationData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ViolationData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ViolationData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.ParamaterValue) > 0 { + i -= len(m.ParamaterValue) + copy(dAtA[i:], m.ParamaterValue) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ParamaterValue))) + i-- + dAtA[i] = 0x22 + } + if len(m.ParameterName) > 0 { + i -= len(m.ParameterName) + copy(dAtA[i:], m.ParameterName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.ParameterName))) + i-- + dAtA[i] = 0x1a + } + if len(m.Context) > 0 { + i -= len(m.Context) + copy(dAtA[i:], m.Context) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Context))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvent(dAtA []byte, offset int, v uint64) int { + offset -= sovEvent(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Metadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Module) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.UUID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.CorrelationID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.Timestamp != nil { + l = m.Timestamp.Size() + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.EventLevel) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Type) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Category) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Event) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovEvent(uint64(l)) + } + if m.Data != nil { + n += m.Data.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Event_ActivityEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ActivityEvent != nil { + l = m.ActivityEvent.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} +func (m *Event_SecurityViolationEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SecurityViolationEvent != nil { + l = m.SecurityViolationEvent.Size() + n += 1 + l + sovEvent(uint64(l)) + } + return n +} +func (m *EventReport) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ActivityEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if len(m.Dimensions) > 0 { + for _, e := range m.Dimensions { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SecurityViolationEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.DateTime) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.PolicyName) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.SupportID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Outcome) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.OutcomeReason) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.BlockingExceptionReason) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Method) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Protocol) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.XForwardedForHeaderValue) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.URI) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Request) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.IsTruncated) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.RequestStatus) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ResponseCode) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.GeoIP) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Host) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.UnitHostname) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SourceHost) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.VSName) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.IPClient) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.DestinationPort) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SourcePort) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Violations) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SubViolations) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ViolationRating) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigID) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigSetNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SigCVEs) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientClass) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientApplication) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ClientApplicationVersion) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Severity) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.SeverityLabel) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Priority) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ThreatCampaignNames) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotAnomalies) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotCategory) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.EnforcedBotAnomalies) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.BotSignatureName) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.ViolationContexts) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + if len(m.ViolationsData) > 0 { + for _, e := range m.ViolationsData { + l = e.Size() + n += 2 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *SignatureData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Buffer) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Offset) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Length) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ViolationData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.Context) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ParameterName) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + l = len(m.ParamaterValue) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } + if len(m.Signatures) > 0 { + for _, e := range m.Signatures { + l = e.Size() + n += 1 + l + sovEvent(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovEvent(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvent(x uint64) (n int) { + return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Metadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Metadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Metadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Module = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UUID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UUID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorrelationID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CorrelationID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = &types.Timestamp{} + } + if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EventLevel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EventLevel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Category = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Event) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Event: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &Metadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ActivityEvent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &ActivityEvent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Event_ActivityEvent{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SecurityViolationEvent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &SecurityViolationEvent{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Event_SecurityViolationEvent{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventReport) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventReport: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventReport: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Events = append(m.Events, &Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ActivityEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ActivityEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ActivityEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Dimensions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Dimensions = append(m.Dimensions, &common.Dimension{}) + if err := m.Dimensions[len(m.Dimensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SecurityViolationEvent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SecurityViolationEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SecurityViolationEvent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DateTime", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DateTime = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PolicyName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PolicyName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SupportID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SupportID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Outcome", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Outcome = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutcomeReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OutcomeReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockingExceptionReason", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockingExceptionReason = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Method = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Protocol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field XForwardedForHeaderValue", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.XForwardedForHeaderValue = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URI", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URI = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Request = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IsTruncated", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IsTruncated = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RequestStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RequestStatus = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseCode", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResponseCode = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GeoIP", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GeoIP = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnitHostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UnitHostname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceHost", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceHost = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VSName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VSName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IPClient", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.IPClient = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationPort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationPort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourcePort", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourcePort = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Violations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Violations = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubViolations", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubViolations = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ViolationRating", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ViolationRating = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 27: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigNames = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 28: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigSetNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigSetNames = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 29: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SigCVEs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SigCVEs = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 30: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientClass", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientClass = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 31: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientApplication", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientApplication = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 32: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientApplicationVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientApplicationVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 33: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Severity", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Severity = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeverityLabel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SeverityLabel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 35: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Priority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Priority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 36: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Module", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ThreatCampaignNames", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -776,11 +3930,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Module = string(dAtA[iNdEx:postIndex]) + m.ThreatCampaignNames = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 37: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UUID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotAnomalies", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -808,11 +3962,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UUID = string(dAtA[iNdEx:postIndex]) + m.BotAnomalies = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 38: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CorrelationID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotCategory", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -840,13 +3994,13 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.CorrelationID = string(dAtA[iNdEx:postIndex]) + m.BotCategory = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 39: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EnforcedBotAnomalies", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -856,31 +4010,27 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Timestamp == nil { - m.Timestamp = &types.Timestamp{} - } - if err := m.Timestamp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EnforcedBotAnomalies = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 40: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EventLevel", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BotSignatureName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -908,11 +4058,11 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.EventLevel = string(dAtA[iNdEx:postIndex]) + m.BotSignatureName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 41: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ViolationContexts", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -940,13 +4090,13 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.ViolationContexts = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 42: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Category", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ViolationsData", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -956,23 +4106,25 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - m.Category = string(dAtA[iNdEx:postIndex]) + m.ViolationsData = append(m.ViolationsData, &ViolationData{}) + if err := m.ViolationsData[len(m.ViolationsData)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -996,7 +4148,7 @@ func (m *Metadata) Unmarshal(dAtA []byte) error { } return nil } -func (m *Event) Unmarshal(dAtA []byte) error { +func (m *SignatureData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1019,17 +4171,17 @@ func (m *Event) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Event: wiretype end group for non-group") + return fmt.Errorf("proto: SignatureData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SignatureData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1039,33 +4191,61 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Metadata == nil { - m.Metadata = &Metadata{} + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) } - if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF } + m.Buffer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ActivityEvent", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1075,26 +4255,55 @@ func (m *Event) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - v := &ActivityEvent{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.Offset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) } - m.Data = &Event_ActivityEvent{v} + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Length = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -1118,7 +4327,7 @@ func (m *Event) Unmarshal(dAtA []byte) error { } return nil } -func (m *EventReport) Unmarshal(dAtA []byte) error { +func (m *ViolationData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1141,17 +4350,17 @@ func (m *EventReport) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: EventReport: wiretype end group for non-group") + return fmt.Errorf("proto: ViolationData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: EventReport: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ViolationData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowEvent @@ -1161,80 +4370,91 @@ func (m *EventReport) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthEvent } if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, &Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvent(dAtA[iNdEx:]) - if err != nil { - return err + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthEvent } - if (iNdEx + skippy) > l { + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ActivityEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvent + m.Context = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterName", wireType) } - if iNdEx >= l { - return io.ErrUnexpectedEOF + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ActivityEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ActivityEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ParameterName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ParamaterValue", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1262,11 +4482,11 @@ func (m *ActivityEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Message = string(dAtA[iNdEx:postIndex]) + m.ParamaterValue = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dimensions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1293,8 +4513,8 @@ func (m *ActivityEvent) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Dimensions = append(m.Dimensions, &common.Dimension{}) - if err := m.Dimensions[len(m.Dimensions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Signatures = append(m.Signatures, &SignatureData{}) + if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto b/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto index a7e4f4c27..143cb259e 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/events/event.proto @@ -20,6 +20,19 @@ message Event { Metadata Metadata = 1 [(gogoproto.jsontag) = "metadata" ]; oneof data { ActivityEvent ActivityEvent = 2 [(gogoproto.jsontag) = "activity_event" ]; + + // While generating the SecurityViolationEvent, the Metadata for a SecurityViolationEvent + // would look as shown below: + // * Module = Agent + // * UUID = A UUID generated by the Agent for the EventReport + // * CorrelationID = The UUID will be used as the Correlation ID to track the EventReport + // * Timestamp = The timestamp when NGINX Agent received the violation event + // * EventLevel = All the SecurityViolationEvent would be generated at an ERROR_EVENT_LEVEL ("ERROR") level + // In future, the levels might be dynamically chosen based on Request Outcome of SecurityViolationEvent + // * Type = NGINX_EVENT_TYPE ("Nginx") + // * Category = APP_PROTECT_CATEGORY ("AppProtect") + // + SecurityViolationEvent SecurityViolationEvent = 3 [(gogoproto.jsontag) = "security_violation_event" ]; } } @@ -30,4 +43,77 @@ message EventReport { message ActivityEvent { string Message = 1 [(gogoproto.jsontag) = "message" ]; repeated f5.nginx.agent.sdk.common.Dimension Dimensions = 2 [(gogoproto.jsontag) = "dimensions" ]; +} + +// SecurityViolationEvent represents a Security Violation that is emitted by the Agent +message SecurityViolationEvent { + string DateTime = 1 [(gogoproto.jsontag) = "date_time" ]; + string PolicyName = 2 [(gogoproto.jsontag) = "policy_name" ]; + string SupportID = 3 [(gogoproto.jsontag) = "support_id" ]; + + string Outcome = 4 [(gogoproto.jsontag) = "outcome" ]; + string OutcomeReason = 5 [(gogoproto.jsontag) = "outcome_reason" ]; + string BlockingExceptionReason = 6 [(gogoproto.jsontag) = "blocking_exception_reason" ]; + + string Method = 7 [(gogoproto.jsontag) = "method" ]; + string Protocol = 8 [(gogoproto.jsontag) = "protocol" ]; + string XForwardedForHeaderValue = 9 [(gogoproto.jsontag) = "xff_header_value" ]; + + string URI = 10 [(gogoproto.jsontag) = "uri" ]; + string Request = 11 [(gogoproto.jsontag) = "request" ]; + string IsTruncated = 12 [(gogoproto.jsontag) = "is_truncated" ]; + string RequestStatus = 13 [(gogoproto.jsontag) = "request_status" ]; + string ResponseCode = 14 [(gogoproto.jsontag) = "response_code" ]; + + string GeoIP = 15 [(gogoproto.jsontag) = "geo_ip" ]; + string Host = 16 [(gogoproto.jsontag) = "host" ]; + string UnitHostname = 17 [(gogoproto.jsontag) = "unit_hostname" ]; + string SourceHost = 18 [(gogoproto.jsontag) = "source_host" ]; + string VSName = 19 [(gogoproto.jsontag) = "vs_name" ]; + string IPClient = 20 [(gogoproto.jsontag) = "ip_client" ]; + string DestinationPort = 21 [(gogoproto.jsontag) = "destination_port" ]; + string SourcePort = 22 [(gogoproto.jsontag) = "source_port" ]; + + string Violations = 23 [(gogoproto.jsontag) = "violations" ]; + string SubViolations = 24 [(gogoproto.jsontag) = "sub_violations" ]; + string ViolationRating = 25 [(gogoproto.jsontag) = "violation_rating" ]; + + string SigID = 26 [(gogoproto.jsontag) = "sig_id" ]; + string SigNames = 27 [(gogoproto.jsontag) = "sig_names" ]; + string SigSetNames = 28 [(gogoproto.jsontag) = "sig_set_names" ]; + string SigCVEs = 29 [(gogoproto.jsontag) = "sig_cves" ]; + + string ClientClass = 30 [(gogoproto.jsontag) = "client_class" ]; + string ClientApplication = 31 [(gogoproto.jsontag) = "client_application" ]; + string ClientApplicationVersion = 32 [(gogoproto.jsontag) = "client_application_version" ]; + + string Severity = 33 [(gogoproto.jsontag) = "severity" ]; + // NOTE: Severity Label might be deprecated if we have no use for it + string SeverityLabel = 34 [(gogoproto.jsontag) = "severity_label" ]; + string Priority = 35 [(gogoproto.jsontag) = "priority" ]; + + string ThreatCampaignNames = 36 [(gogoproto.jsontag) = "threat_campaign_names" ]; + + string BotAnomalies = 37 [(gogoproto.jsontag) = "bot_anomalies" ]; + string BotCategory = 38 [(gogoproto.jsontag) = "bot_category" ]; + string EnforcedBotAnomalies = 39 [(gogoproto.jsontag) = "enforced_bot_anomalies" ]; + string BotSignatureName = 40 [(gogoproto.jsontag) = "bot_signature_name" ]; + + string ViolationContexts = 41 [(gogoproto.jsontag) = "violation_contexts" ]; + repeated ViolationData ViolationsData = 42 [(gogoproto.jsontag) = "violations_data" ]; +} + +message SignatureData { + string ID = 1 [(gogoproto.jsontag) = "sig_data_id" ]; + string Buffer = 2 [(gogoproto.jsontag) = "sig_data_buffer" ]; + string Offset = 3 [(gogoproto.jsontag) = "sig_data_offset" ]; + string Length = 4 [(gogoproto.jsontag) = "sig_data_length" ]; +} + +message ViolationData { + string Name = 1 [(gogoproto.jsontag) = "violation_data_name" ]; + string Context = 2 [(gogoproto.jsontag) = "violation_data_context" ]; + string ParameterName = 3 [(gogoproto.jsontag) = "violation_data_param_name" ]; + string ParamaterValue = 4 [(gogoproto.jsontag) = "violation_data_param_value" ]; + repeated SignatureData Signatures = 5 [(gogoproto.jsontag) = "violation_data_signatures" ]; } \ No newline at end of file diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go b/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go new file mode 100644 index 000000000..654309820 --- /dev/null +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ingest_svc.proto + +package proto + +import ( + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + events "github.com/nginx/agent/sdk/v2/proto/events" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func init() { proto.RegisterFile("ingest_svc.proto", fileDescriptor_e87a1d7991134362) } + +var fileDescriptor_e87a1d7991134362 = []byte{ + // 232 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0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6, 0x67, 0x96, 0x64, 0x94, 0x26, + 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0x0d, 0xd6, 0x07, 0x1b, 0xac, 0x5f, 0x9c, 0x92, 0xad, 0x5f, + 0x66, 0x04, 0x09, 0x20, 0x6b, 0x88, 0x29, 0x6c, 0x60, 0xca, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, + 0x56, 0x21, 0x22, 0x28, 0x63, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// IngesterClient is the client API for Ingester service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type IngesterClient interface { + // A client-to-server streaming RPC to deliver high volume metrics reports. + StreamMetricsReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamMetricsReportClient, error) + // A client-to-server streaming RPC to deliver high volume event reports. + StreamEventReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamEventReportClient, error) +} + +type ingesterClient struct { + cc *grpc.ClientConn +} + +func NewIngesterClient(cc *grpc.ClientConn) IngesterClient { + return &ingesterClient{cc} +} + +func (c *ingesterClient) StreamMetricsReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamMetricsReportClient, error) { + stream, err := c.cc.NewStream(ctx, &_Ingester_serviceDesc.Streams[0], "/f5.nginx.agent.sdk.Ingester/StreamMetricsReport", opts...) + if err != nil { + return nil, err + } + x := &ingesterStreamMetricsReportClient{stream} + return x, nil +} + +type Ingester_StreamMetricsReportClient interface { + Send(*MetricsReport) error + CloseAndRecv() (*types.Empty, error) + grpc.ClientStream +} + +type ingesterStreamMetricsReportClient struct { + grpc.ClientStream +} + +func (x *ingesterStreamMetricsReportClient) Send(m *MetricsReport) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ingesterStreamMetricsReportClient) CloseAndRecv() (*types.Empty, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(types.Empty) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ingesterClient) StreamEventReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamEventReportClient, error) { + stream, err := c.cc.NewStream(ctx, &_Ingester_serviceDesc.Streams[1], "/f5.nginx.agent.sdk.Ingester/StreamEventReport", opts...) + if err != nil { + return nil, err + } + x := &ingesterStreamEventReportClient{stream} + return x, nil +} + +type Ingester_StreamEventReportClient interface { + Send(*events.EventReport) error + CloseAndRecv() (*types.Empty, error) + grpc.ClientStream +} + +type ingesterStreamEventReportClient struct { + grpc.ClientStream +} + +func (x *ingesterStreamEventReportClient) Send(m *events.EventReport) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ingesterStreamEventReportClient) CloseAndRecv() (*types.Empty, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(types.Empty) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// IngesterServer is the server API for Ingester service. +type IngesterServer interface { + // A client-to-server streaming RPC to deliver high volume metrics reports. + StreamMetricsReport(Ingester_StreamMetricsReportServer) error + // A client-to-server streaming RPC to deliver high volume event reports. + StreamEventReport(Ingester_StreamEventReportServer) error +} + +// UnimplementedIngesterServer can be embedded to have forward compatible implementations. +type UnimplementedIngesterServer struct { +} + +func (*UnimplementedIngesterServer) StreamMetricsReport(srv Ingester_StreamMetricsReportServer) error { + return status.Errorf(codes.Unimplemented, "method StreamMetricsReport not implemented") +} +func (*UnimplementedIngesterServer) StreamEventReport(srv Ingester_StreamEventReportServer) error { + return status.Errorf(codes.Unimplemented, "method StreamEventReport not implemented") +} + +func RegisterIngesterServer(s *grpc.Server, srv IngesterServer) { + s.RegisterService(&_Ingester_serviceDesc, srv) +} + +func _Ingester_StreamMetricsReport_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(IngesterServer).StreamMetricsReport(&ingesterStreamMetricsReportServer{stream}) +} + +type Ingester_StreamMetricsReportServer interface { + SendAndClose(*types.Empty) error + Recv() (*MetricsReport, error) + grpc.ServerStream +} + +type ingesterStreamMetricsReportServer struct { + grpc.ServerStream +} + +func (x *ingesterStreamMetricsReportServer) SendAndClose(m *types.Empty) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ingesterStreamMetricsReportServer) Recv() (*MetricsReport, error) { + m := new(MetricsReport) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Ingester_StreamEventReport_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(IngesterServer).StreamEventReport(&ingesterStreamEventReportServer{stream}) +} + +type Ingester_StreamEventReportServer interface { + SendAndClose(*types.Empty) error + Recv() (*events.EventReport, error) + grpc.ServerStream +} + +type ingesterStreamEventReportServer struct { + grpc.ServerStream +} + +func (x *ingesterStreamEventReportServer) SendAndClose(m *types.Empty) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ingesterStreamEventReportServer) Recv() (*events.EventReport, error) { + m := new(events.EventReport) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Ingester_serviceDesc = grpc.ServiceDesc{ + ServiceName: "f5.nginx.agent.sdk.Ingester", + HandlerType: (*IngesterServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamMetricsReport", + Handler: _Ingester_StreamMetricsReport_Handler, + ClientStreams: true, + }, + { + StreamName: "StreamEventReport", + Handler: _Ingester_StreamEventReport_Handler, + ClientStreams: true, + }, + }, + Metadata: "ingest_svc.proto", +} diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto b/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto new file mode 100644 index 000000000..9c362e739 --- /dev/null +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; +package f5.nginx.agent.sdk; +option go_package = "github.com/nginx/agent/sdk/v2/proto;proto"; + +import "google/protobuf/empty.proto"; +import "metrics.proto"; +import "events/event.proto"; + +// Ingester is responsible for ingesting high volume metrics and events +service Ingester { + // A client-to-server streaming RPC to deliver high volume metrics reports. + rpc StreamMetricsReport(stream MetricsReport) returns (google.protobuf.Empty) {} + + // A client-to-server streaming RPC to deliver high volume event reports. + rpc StreamEventReport(stream f5.nginx.agent.sdk.events.EventReport) returns (google.protobuf.Empty) {} +} diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.pb.go b/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.pb.go index fce099c19..698ca65fe 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.pb.go +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.pb.go @@ -28,20 +28,20 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("metrics.svc.proto", fileDescriptor_ece8a4321458910f) } var fileDescriptor_ece8a4321458910f = []byte{ - // 194 bytes of a gzipped FileDescriptorProto + // 199 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcc, 0x4d, 0x2d, 0x29, 0xca, 0x4c, 0x2e, 0xd6, 0x2b, 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4a, 0x33, 0xd5, 0xcb, 0x4b, 0xcf, 0xcc, 0xab, 0xd0, 0x4b, 0x4c, 0x4f, 0xcd, 0x2b, 0xd1, 0x2b, 0x4e, 0xc9, 0x96, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xab, 0x48, 0x2a, 0x4d, 0xd3, - 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0x85, 0x99, 0x01, 0xe6, 0x1a, 0x45, 0x72, + 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0x85, 0x99, 0x01, 0xe6, 0x1a, 0xc5, 0x71, 0xf1, 0xf9, 0x42, 0x04, 0x82, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0x85, 0xdc, 0xb9, 0xd8, 0x82, 0x4b, 0x8a, 0x52, 0x13, 0x73, 0x85, 0x14, 0xf5, 0x30, 0x0d, 0xd7, 0x83, 0xaa, 0x0e, 0x4a, 0x2d, 0xc8, 0x2f, 0x2a, 0x91, 0x12, 0xd3, 0x83, 0xd8, 0xa5, 0x07, 0xb3, 0x4b, 0xcf, 0x15, 0x64, 0x97, - 0x12, 0x83, 0x06, 0xa3, 0x93, 0xf9, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, - 0x24, 0xc7, 0x18, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x0f, - 0x36, 0x53, 0x1f, 0x6c, 0xa6, 0x7e, 0x71, 0x4a, 0xb6, 0x7e, 0x99, 0x11, 0xc4, 0xad, 0xd6, 0x10, - 0x53, 0xd8, 0xc0, 0x94, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x58, 0x03, 0x87, 0xd1, 0xef, 0x00, - 0x00, 0x00, + 0x12, 0x83, 0x06, 0xa3, 0x14, 0x73, 0x07, 0x13, 0xa3, 0x93, 0xf9, 0x89, 0x47, 0x72, 0x8c, 0x17, + 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x18, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, + 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x36, 0x58, 0x1f, 0x6c, 0xb0, 0x7e, 0x71, 0x4a, 0xb6, 0x7e, 0x99, + 0x11, 0xc4, 0xc1, 0xd6, 0x10, 0xa3, 0xd8, 0xc0, 0x94, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x04, + 0x53, 0x50, 0x03, 0xf4, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -55,6 +55,8 @@ const _ = grpc.SupportPackageIsVersion4 // MetricsServiceClient is the client API for MetricsService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +// +// Deprecated: Do not use. type MetricsServiceClient interface { // A client-to-server streaming RPC to deliver high volume metrics reports. Stream(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamClient, error) @@ -64,6 +66,7 @@ type metricsServiceClient struct { cc *grpc.ClientConn } +// Deprecated: Do not use. func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient { return &metricsServiceClient{cc} } @@ -103,11 +106,14 @@ func (x *metricsServiceStreamClient) CloseAndRecv() (*types.Empty, error) { } // MetricsServiceServer is the server API for MetricsService service. +// +// Deprecated: Do not use. type MetricsServiceServer interface { // A client-to-server streaming RPC to deliver high volume metrics reports. Stream(MetricsService_StreamServer) error } +// Deprecated: Do not use. // UnimplementedMetricsServiceServer can be embedded to have forward compatible implementations. type UnimplementedMetricsServiceServer struct { } @@ -116,6 +122,7 @@ func (*UnimplementedMetricsServiceServer) Stream(srv MetricsService_StreamServer return status.Errorf(codes.Unimplemented, "method Stream not implemented") } +// Deprecated: Do not use. func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) { s.RegisterService(&_MetricsService_serviceDesc, srv) } diff --git a/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.proto b/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.proto index 6da52b29d..62488ac44 100644 --- a/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.proto +++ b/vendor/github.com/nginx/agent/sdk/v2/proto/metrics.svc.proto @@ -7,6 +7,7 @@ import "metrics.proto"; // Interface exported by the server. service MetricsService { + option deprecated = true; // A client-to-server streaming RPC to deliver high volume metrics reports. rpc Stream(stream MetricsReport) returns (google.protobuf.Empty) {} From ada1301062faf754c70da983c0996f13bd5aa7ff Mon Sep 17 00:00:00 2001 From: "m.gougam" Date: Tue, 6 Sep 2022 20:39:51 +0100 Subject: [PATCH 2/2] feat: nap monitoring; --- Makefile | 2 +- go.mod | 3 +- go.sum | 2 + go.work.sum | 1 + main.go | 9 + sdk/Makefile | 1 + sdk/client/client.go | 1 + sdk/client/message.go | 11 + sdk/client/metric_reporter.go | 63 +- sdk/client/metric_reporter_test.go | 59 +- sdk/config_helpers_test.go | 2 +- sdk/examples/services/metrics_service.go | 26 +- sdk/proto/events/event.pb.go | 872 +++++++++++++++--- sdk/proto/events/event.proto | 52 +- sdk/proto/ingest_svc.pb.go | 236 ----- sdk/proto/ingest_svc.proto | 16 - sdk/proto/metrics.svc.pb.go | 102 +- sdk/proto/metrics.svc.proto | 8 +- src/core/config/config.go | 21 + src/core/config/defaults.go | 35 + src/core/config/types.go | 10 + .../pkg/schema/schema_builder.go | 3 +- .../advanced-metrics/reader/reader.go | 7 +- .../advanced-metrics/tables/schema/field.go | 3 +- .../advanced-metrics/tables/staging_table.go | 5 +- .../monitoring/collector/collector.go | 15 + .../monitoring/collector/config.go | 12 + .../monitoring/collector/nap.go | 109 +++ .../monitoring/collector/nap_test.go | 70 ++ .../monitoring/manager/manager.go | 158 ++++ .../monitoring/manager/manager_test.go | 39 + .../monitoring/processor/config.go | 14 + .../monitoring/processor/metadata.go | 33 + .../monitoring/processor/nap.go | 591 ++++++++++++ .../monitoring/processor/nap_test.go | 41 + .../monitoring/processor/processor.go | 145 +++ .../monitoring/processor/processor_test.go | 132 +++ .../testdata/expanded_nap_waf.log.txt | 1 + .../testdata/xml_header_data.log.txt | 1 + .../testdata/xml_parameter_data.log.txt | 1 + .../xml_parameter_data_as_param_data.log.txt | 1 + .../xml_parameter_data_empty_context.log.txt | 1 + .../testdata/xml_signature_data.log.txt | 1 + .../testdata/xml_violation_name.log.txt | 1 + .../nginx-app-protect/monitoring/types.go | 48 + src/plugins/commander.go | 4 +- src/plugins/comms.go | 62 +- src/plugins/config_reader.go | 4 +- src/plugins/extensions.go | 23 +- src/plugins/nap_monitoring.go | 126 +++ src/plugins/nap_monitoring_test.go | 94 ++ .../advanced_metrics_component_test.go | 2 +- .../monitoring/mock/ingestion.go | 84 ++ .../monitoring/monitoring_test.go | 233 +++++ .../events-out/expanded_nap_waf.log.txt.out | 10 + .../events-out/xml_header_data.log.txt.out | 3 + .../events-out/xml_parameter_data.log.txt.out | 3 + ...l_parameter_data_as_param_data.log.txt.out | 3 + ...l_parameter_data_empty_context.log.txt.out | 5 + .../events-out/xml_signature_data.log.txt.out | 20 + .../events-out/xml_violation_name.log.txt.out | 5 + .../testData/logs-in/expanded_nap_waf.log.txt | 1 + .../testData/logs-in/xml_header_data.log.txt | 1 + .../logs-in/xml_parameter_data.log.txt | 1 + .../xml_parameter_data_as_param_data.log.txt | 1 + .../xml_parameter_data_empty_context.log.txt | 1 + .../logs-in/xml_signature_data.log.txt | 1 + .../logs-in/xml_violation_name.log.txt | 1 + test/performance/go.mod | 1 + test/performance/go.sum | 2 + test/performance/metrics_test.go | 37 +- .../github.com/nginx/agent/sdk/v2/Makefile | 1 + .../nginx/agent/sdk/v2/client/client.go | 1 + .../nginx/agent/sdk/v2/client/message.go | 11 + .../agent/sdk/v2/client/metric_reporter.go | 63 +- .../agent/sdk/v2/proto/events/event.pb.go | 872 +++++++++++++++--- .../agent/sdk/v2/proto/events/event.proto | 52 +- .../nginx/agent/sdk/v2/proto/ingest_svc.pb.go | 236 ----- .../nginx/agent/sdk/v2/proto/ingest_svc.proto | 16 - .../agent/sdk/v2/proto/metrics.svc.pb.go | 102 +- .../agent/sdk/v2/proto/metrics.svc.proto | 12 +- .../nginx/agent/v2/src/core/config/config.go | 21 + .../agent/v2/src/core/config/defaults.go | 35 + .../nginx/agent/v2/src/core/config/types.go | 10 + .../pkg/schema/schema_builder.go | 3 +- .../advanced-metrics/reader/reader.go | 7 +- .../advanced-metrics/tables/schema/field.go | 3 +- .../advanced-metrics/tables/staging_table.go | 5 +- .../monitoring/collector/collector.go | 15 + .../monitoring/collector/config.go | 12 + .../monitoring/collector/nap.go | 112 +++ .../monitoring/manager/manager.go | 157 ++++ .../monitoring/processor/config.go | 14 + .../monitoring/processor/metadata.go | 33 + .../monitoring/processor/nap.go | 597 ++++++++++++ .../monitoring/processor/processor.go | 129 +++ .../nginx-app-protect/monitoring/types.go | 48 + .../nginx/agent/v2/src/plugins/commander.go | 4 +- .../nginx/agent/v2/src/plugins/comms.go | 63 +- .../agent/v2/src/plugins/config_reader.go | 4 +- .../nginx/agent/v2/src/plugins/extensions.go | 20 + .../agent/v2/src/plugins/nap_monitoring.go | 130 +++ .../mcuadros/go-syslog.v2/.travis.yml | 21 + .../gopkg.in/mcuadros/go-syslog.v2/LICENSE | 19 + .../gopkg.in/mcuadros/go-syslog.v2/README.md | 48 + .../gopkg.in/mcuadros/go-syslog.v2/doc.go | 5 + .../mcuadros/go-syslog.v2/format/automatic.go | 104 +++ .../mcuadros/go-syslog.v2/format/format.go | 29 + .../mcuadros/go-syslog.v2/format/rfc3164.go | 17 + .../mcuadros/go-syslog.v2/format/rfc5424.go | 17 + .../mcuadros/go-syslog.v2/format/rfc6587.go | 45 + .../gopkg.in/mcuadros/go-syslog.v2/handler.go | 35 + .../internal/syslogparser/LICENSE | 23 + .../internal/syslogparser/README.md | 4 + .../internal/syslogparser/rfc3164/rfc3164.go | 292 ++++++ .../internal/syslogparser/rfc5424/rfc5424.go | 606 ++++++++++++ .../internal/syslogparser/syslogparser.go | 213 +++++ .../gopkg.in/mcuadros/go-syslog.v2/server.go | 378 ++++++++ test/performance/vendor/modules.txt | 11 + test/utils/environment.go | 30 +- vendor/github.com/nginx/agent/sdk/v2/Makefile | 1 + .../nginx/agent/sdk/v2/client/client.go | 1 + .../nginx/agent/sdk/v2/client/message.go | 11 + .../agent/sdk/v2/client/metric_reporter.go | 63 +- .../agent/sdk/v2/proto/events/event.pb.go | 872 +++++++++++++++--- .../agent/sdk/v2/proto/events/event.proto | 52 +- .../nginx/agent/sdk/v2/proto/ingest_svc.pb.go | 236 ----- .../nginx/agent/sdk/v2/proto/ingest_svc.proto | 16 - .../agent/sdk/v2/proto/metrics.svc.pb.go | 102 +- .../agent/sdk/v2/proto/metrics.svc.proto | 12 +- .../mcuadros/go-syslog.v2/.travis.yml | 21 + vendor/gopkg.in/mcuadros/go-syslog.v2/LICENSE | 19 + .../gopkg.in/mcuadros/go-syslog.v2/README.md | 48 + vendor/gopkg.in/mcuadros/go-syslog.v2/doc.go | 5 + .../mcuadros/go-syslog.v2/format/automatic.go | 104 +++ .../mcuadros/go-syslog.v2/format/format.go | 29 + .../mcuadros/go-syslog.v2/format/rfc3164.go | 17 + .../mcuadros/go-syslog.v2/format/rfc5424.go | 17 + .../mcuadros/go-syslog.v2/format/rfc6587.go | 45 + .../gopkg.in/mcuadros/go-syslog.v2/handler.go | 35 + .../internal/syslogparser/LICENSE | 23 + .../internal/syslogparser/README.md | 4 + .../internal/syslogparser/rfc3164/rfc3164.go | 292 ++++++ .../internal/syslogparser/rfc5424/rfc5424.go | 606 ++++++++++++ .../internal/syslogparser/syslogparser.go | 213 +++++ .../gopkg.in/mcuadros/go-syslog.v2/server.go | 378 ++++++++ vendor/modules.txt | 7 + 147 files changed, 10142 insertions(+), 1464 deletions(-) delete mode 100644 sdk/proto/ingest_svc.pb.go delete mode 100644 sdk/proto/ingest_svc.proto create mode 100644 src/extensions/nginx-app-protect/monitoring/collector/collector.go create mode 100644 src/extensions/nginx-app-protect/monitoring/collector/config.go create mode 100644 src/extensions/nginx-app-protect/monitoring/collector/nap.go create mode 100644 src/extensions/nginx-app-protect/monitoring/collector/nap_test.go create mode 100644 src/extensions/nginx-app-protect/monitoring/manager/manager.go create mode 100644 src/extensions/nginx-app-protect/monitoring/manager/manager_test.go create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/config.go create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/metadata.go create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/nap.go create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/nap_test.go create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/processor.go create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/processor_test.go create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/testdata/expanded_nap_waf.log.txt create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/testdata/xml_header_data.log.txt create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/testdata/xml_parameter_data.log.txt create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/testdata/xml_parameter_data_as_param_data.log.txt create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/testdata/xml_parameter_data_empty_context.log.txt create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/testdata/xml_signature_data.log.txt create mode 100644 src/extensions/nginx-app-protect/monitoring/processor/testdata/xml_violation_name.log.txt create mode 100644 src/extensions/nginx-app-protect/monitoring/types.go create mode 100644 src/plugins/nap_monitoring.go create mode 100644 src/plugins/nap_monitoring_test.go create mode 100644 test/component/nginx-app-protect/monitoring/mock/ingestion.go create mode 100644 test/component/nginx-app-protect/monitoring/monitoring_test.go create mode 100644 test/component/nginx-app-protect/monitoring/testData/events-out/expanded_nap_waf.log.txt.out create mode 100644 test/component/nginx-app-protect/monitoring/testData/events-out/xml_header_data.log.txt.out create mode 100644 test/component/nginx-app-protect/monitoring/testData/events-out/xml_parameter_data.log.txt.out create mode 100644 test/component/nginx-app-protect/monitoring/testData/events-out/xml_parameter_data_as_param_data.log.txt.out create mode 100644 test/component/nginx-app-protect/monitoring/testData/events-out/xml_parameter_data_empty_context.log.txt.out create mode 100644 test/component/nginx-app-protect/monitoring/testData/events-out/xml_signature_data.log.txt.out create mode 100644 test/component/nginx-app-protect/monitoring/testData/events-out/xml_violation_name.log.txt.out create mode 100644 test/component/nginx-app-protect/monitoring/testData/logs-in/expanded_nap_waf.log.txt create mode 100644 test/component/nginx-app-protect/monitoring/testData/logs-in/xml_header_data.log.txt create mode 100644 test/component/nginx-app-protect/monitoring/testData/logs-in/xml_parameter_data.log.txt create mode 100644 test/component/nginx-app-protect/monitoring/testData/logs-in/xml_parameter_data_as_param_data.log.txt create mode 100644 test/component/nginx-app-protect/monitoring/testData/logs-in/xml_parameter_data_empty_context.log.txt create mode 100644 test/component/nginx-app-protect/monitoring/testData/logs-in/xml_signature_data.log.txt create mode 100644 test/component/nginx-app-protect/monitoring/testData/logs-in/xml_violation_name.log.txt delete mode 100644 test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go delete mode 100644 test/performance/vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/collector/collector.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/collector/config.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/collector/nap.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/manager/manager.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/processor/config.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/processor/metadata.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/processor/nap.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/processor/processor.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/types.go create mode 100644 test/performance/vendor/github.com/nginx/agent/v2/src/plugins/nap_monitoring.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/.travis.yml create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/LICENSE create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/README.md create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/doc.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/format/automatic.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc3164.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc5424.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc6587.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/handler.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/LICENSE create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/README.md create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/rfc3164/rfc3164.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/rfc5424/rfc5424.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/syslogparser.go create mode 100644 test/performance/vendor/gopkg.in/mcuadros/go-syslog.v2/server.go delete mode 100644 vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.pb.go delete mode 100644 vendor/github.com/nginx/agent/sdk/v2/proto/ingest_svc.proto create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/.travis.yml create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/LICENSE create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/README.md create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/doc.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/format/automatic.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/format/format.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc3164.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc5424.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/format/rfc6587.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/handler.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/LICENSE create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/README.md create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/rfc3164/rfc3164.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/rfc5424/rfc5424.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/internal/syslogparser/syslogparser.go create mode 100644 vendor/gopkg.in/mcuadros/go-syslog.v2/server.go diff --git a/Makefile b/Makefile index c7c1d94ed..ed715be70 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ test-docker-component: ## Run integration tests in docker for container in `docker ps -aqf "name=^nginx-agent_"`; do echo && docker ps -f "id=$$container" --format "{{.Image}}" && docker exec $$container ./tmp/component.test -test.v; done test-component-run: ## Run component tests - GOWORK=off CGO_ENABLED=0 go test -v ./test/component + GOWORK=off CGO_ENABLED=0 go test -v ./test/component/... # Performance tests performance-test: ## Run performance tests diff --git a/go.mod b/go.mod index 7282674bc..d645f2277 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/fsnotify/fsnotify v1.5.4 github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.6.0 + github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.8 github.com/google/uuid v1.3.0 github.com/klauspost/cpuid/v2 v2.1.0 @@ -32,6 +33,7 @@ require ( google.golang.org/grpc v1.48.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 google.golang.org/protobuf v1.28.1 + gopkg.in/mcuadros/go-syslog.v2 v2.3.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -43,7 +45,6 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/golang/protobuf v1.5.2 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect diff --git a/go.sum b/go.sum index 2fc396a1c..a2af27749 100644 --- a/go.sum +++ b/go.sum @@ -647,6 +647,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/mcuadros/go-syslog.v2 v2.3.0 h1:kcsiS+WsTKyIEPABJBJtoG0KkOS6yzvJ+/eZlhD79kk= +gopkg.in/mcuadros/go-syslog.v2 v2.3.0/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/go.work.sum b/go.work.sum index 9102bca34..0c4ea91ed 100644 --- a/go.work.sum +++ b/go.work.sum @@ -440,6 +440,7 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/mcuadros/go-syslog.v2 v2.3.0/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= diff --git a/main.go b/main.go index 9413cfed9..050742544 100644 --- a/main.go +++ b/main.go @@ -208,6 +208,15 @@ func loadPlugins(commander client.Commander, binary *core.NginxBinaryType, env * } } + if loadedConfig.NAPMonitoring != (config.NAPMonitoring{}) { + nm, err := plugins.NewNAPMonitoring(env, loadedConfig) + if err != nil { + log.Errorf("Unable to load the Nginx App Protect Monitoring plugin due to the following error: %v", err) + } else { + corePlugins = append(corePlugins, nm) + } + } + return corePlugins } diff --git a/sdk/Makefile b/sdk/Makefile index cc635ca88..14f2d45be 100644 --- a/sdk/Makefile +++ b/sdk/Makefile @@ -27,6 +27,7 @@ Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\ done protoc \ + -I ./proto/events \ -I ./proto \ -I /usr/local/include \ -I ./vendor/github.com/gogo/protobuf/gogoproto \ diff --git a/sdk/client/client.go b/sdk/client/client.go index 0a188700c..b96e62030 100644 --- a/sdk/client/client.go +++ b/sdk/client/client.go @@ -24,6 +24,7 @@ type MsgClassification int const ( MsgClassificationCommand MsgClassification = iota MsgClassificationMetric + MsgClassificationEvent ) var ( diff --git a/sdk/client/message.go b/sdk/client/message.go index 730dfd094..7f6427f5d 100644 --- a/sdk/client/message.go +++ b/sdk/client/message.go @@ -2,6 +2,7 @@ package client import ( "github.com/nginx/agent/sdk/v2/proto" + models "github.com/nginx/agent/sdk/v2/proto/events" ) func MessageFromCommand(cmd *proto.Command) Message { @@ -18,10 +19,18 @@ func MessageFromMetrics(metric *proto.MetricsReport) Message { } } +func MessageFromEvents(event *models.EventReport) Message { + return &msg{ + msgType: MsgClassificationEvent, + event: event, + } +} + type msg struct { msgType MsgClassification cmd *proto.Command metric *proto.MetricsReport + event *models.EventReport } func (m *msg) Meta() *proto.Metadata { @@ -67,6 +76,8 @@ func (m *msg) Raw() interface{} { return m.cmd case MsgClassificationMetric: return m.metric + case MsgClassificationEvent: + return m.event } return nil diff --git a/sdk/client/metric_reporter.go b/sdk/client/metric_reporter.go index 8ba16b5ff..c99f0ce38 100644 --- a/sdk/client/metric_reporter.go +++ b/sdk/client/metric_reporter.go @@ -6,13 +6,15 @@ import ( "io" "sync" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc" + "google.golang.org/grpc/status" + "github.com/nginx/agent/sdk/v2" sdkGRPC "github.com/nginx/agent/sdk/v2/grpc" "github.com/nginx/agent/sdk/v2/interceptors" "github.com/nginx/agent/sdk/v2/proto" - log "github.com/sirupsen/logrus" - "google.golang.org/grpc" - "google.golang.org/grpc/status" + events "github.com/nginx/agent/sdk/v2/proto/events" ) func NewMetricReporterClient() MetricReporter { @@ -26,6 +28,7 @@ type metricReporter struct { *connector client proto.MetricsServiceClient channel proto.MetricsService_StreamClient + eventsChannel proto.MetricsService_StreamEventsClient ctx context.Context mu sync.Mutex backoffSettings BackoffSettings @@ -90,7 +93,16 @@ func (r *metricReporter) createClient() error { log.Infof("Metric reporter retrying to connect to %s", r.grpc.Target()) return err } + + eventsChannel, err := r.client.StreamEvents(r.ctx) + if err != nil { + log.Warnf("Unable to create events channel: %s", err) + log.Infof("Metric reporter retrying to connect to %s", r.grpc.Target()) + return err + } + r.channel = channel + r.eventsChannel = eventsChannel return nil } @@ -125,29 +137,40 @@ func (r *metricReporter) WithBackoffSettings(backoffSettings BackoffSettings) Cl } func (r *metricReporter) Send(ctx context.Context, message Message) error { - var ( - report *proto.MetricsReport - ok bool - ) + var err error switch message.Classification() { case MsgClassificationMetric: - if report, ok = message.Raw().(*proto.MetricsReport); !ok { + report, ok := message.Raw().(*proto.MetricsReport) + if !ok { return fmt.Errorf("MetricReporter expected a metrics report message, but received %T", message.Data()) } - default: - return fmt.Errorf("MetricReporter expected a metrics report message, but received %T", message.Data()) - } - - err := sdk.WaitUntil(r.ctx, r.backoffSettings.initialInterval, r.backoffSettings.maxInterval, r.backoffSettings.sendMaxTimeout, func() error { - if err := r.channel.Send(report); err != nil { - return r.handleGrpcError("Metric Reporter Channel Send", err) + err = sdk.WaitUntil(r.ctx, r.backoffSettings.initialInterval, r.backoffSettings.maxInterval, r.backoffSettings.sendMaxTimeout, func() error { + if err := r.channel.Send(report); err != nil { + return r.handleGrpcError("Metric Reporter Channel Send", err) + } + + log.Tracef("MetricReporter sent metrics report %v", report) + + return nil + }) + case MsgClassificationEvent: + report, ok := message.Raw().(*events.EventReport) + if !ok { + return fmt.Errorf("MetricReporter expected an events report message, but received %T", message.Data()) } + err = sdk.WaitUntil(r.ctx, r.backoffSettings.initialInterval, r.backoffSettings.maxInterval, r.backoffSettings.sendMaxTimeout, func() error { + if err := r.eventsChannel.Send(report); err != nil { + return r.handleGrpcError("Metric Reporter Events Channel Send", err) + } - log.Tracef("MetricReporter sent report %v", report) + log.Tracef("MetricReporter sent events report %v", report) - return nil - }) + return nil + }) + default: + return fmt.Errorf("MetricReporter expected a metrics or events report message, but received %T", message.Data()) + } return err } @@ -157,6 +180,10 @@ func (r *metricReporter) closeConnection() error { if err != nil { return err } + err = r.eventsChannel.CloseSend() + if err != nil { + return err + } return r.grpc.Close() } diff --git a/sdk/client/metric_reporter_test.go b/sdk/client/metric_reporter_test.go index 6b9e12f87..6e137dce5 100644 --- a/sdk/client/metric_reporter_test.go +++ b/sdk/client/metric_reporter_test.go @@ -2,13 +2,14 @@ package client import ( "context" - "fmt" "net" "sync" "testing" "time" "github.com/nginx/agent/sdk/v2/proto" + f5_nginx_agent_sdk_events "github.com/nginx/agent/sdk/v2/proto/events" + log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -152,9 +153,16 @@ type metricReporterHandler struct { metricReportStream chan *proto.MetricsReport } +type eventReporterHandlerFunc func(proto.MetricsService_StreamEventsServer, *sync.WaitGroup) +type eventReporterHandler struct { + streamEventsHandleFunc eventReporterHandlerFunc + eventReportStream chan *f5_nginx_agent_sdk_events.EventReport +} + type mockMetricReporterService struct { sync.RWMutex metricReporterHandler *metricReporterHandler + eventReporterHandler *eventReporterHandler } func (c *mockMetricReporterService) Stream(stream proto.MetricsService_StreamServer) error { @@ -174,6 +182,23 @@ func (c *mockMetricReporterService) Stream(stream proto.MetricsService_StreamSer return nil } +func (c *mockMetricReporterService) StreamEvents(stream proto.MetricsService_StreamEventsServer) error { + wg := &sync.WaitGroup{} + h := c.ensureEventReporterHandler() + wg.Add(1) + + streamEventsHandleFunc := h.streamEventsHandleFunc + if streamEventsHandleFunc == nil { + streamEventsHandleFunc = h.streamEventsHandle + } + + go streamEventsHandleFunc(stream, wg) + + wg.Wait() + + return nil +} + func (c *mockMetricReporterService) ensureMetricReporterHandler() *metricReporterHandler { c.RLock() if c.metricReporterHandler == nil { @@ -188,18 +213,44 @@ func (c *mockMetricReporterService) ensureMetricReporterHandler() *metricReporte return c.metricReporterHandler } +func (c *mockMetricReporterService) ensureEventReporterHandler() *eventReporterHandler { + c.RLock() + if c.eventReporterHandler == nil { + c.RUnlock() + c.Lock() + defer c.Unlock() + c.eventReporterHandler = &eventReporterHandler{} + c.eventReporterHandler.eventReportStream = make(chan *f5_nginx_agent_sdk_events.EventReport) + return c.eventReporterHandler + } + defer c.RUnlock() + return c.eventReporterHandler +} + func (h *metricReporterHandler) streamHandle(server proto.MetricsService_StreamServer, wg *sync.WaitGroup) { for { cmd, err := server.Recv() - fmt.Printf("Recv Metric Report: %v\n", cmd) + log.Debugf("Recv Metric Report: %v\n", cmd) if err != nil { - fmt.Printf("Recv Metric Report: %v\n", err) + log.Debugf("Recv Metric Report: %v\n", err) return } h.metricReportStream <- cmd } } +func (h *eventReporterHandler) streamEventsHandle(server proto.MetricsService_StreamEventsServer, wg *sync.WaitGroup) { + for { + cmd, err := server.Recv() + log.Debugf("Recv Event Report: %v\n", cmd) + if err != nil { + log.Debugf("Recv Event Report: %v\n", err) + return + } + h.eventReportStream <- cmd + } +} + func startMetricReporterMockServer() (*grpc.Server, *mockMetricReporterService, func(context.Context, string) (net.Conn, error)) { listener := bufconn.Listen(1024 * 1024) grpcServer := grpc.NewServer(sdkGRPC.DefaultServerDialOptions...) @@ -210,7 +261,7 @@ func startMetricReporterMockServer() (*grpc.Server, *mockMetricReporterService, go func() { if err := grpcServer.Serve(listener); err != nil { - fmt.Printf("Error starting mock GRPC server: %v\n", err) + log.Errorf("Error starting mock GRPC server: %v\n", err) } }() diff --git a/sdk/config_helpers_test.go b/sdk/config_helpers_test.go index 6cb8edbd1..acbddccac 100644 --- a/sdk/config_helpers_test.go +++ b/sdk/config_helpers_test.go @@ -21,7 +21,7 @@ import ( SDKfiles "github.com/nginx/agent/sdk/v2/files" "github.com/nginx/agent/sdk/v2/proto" "github.com/nginx/agent/sdk/v2/zip" - "github.com/nginxinc/nginx-go-crossplane" + crossplane "github.com/nginxinc/nginx-go-crossplane" log "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/sdk/examples/services/metrics_service.go b/sdk/examples/services/metrics_service.go index b98c97ad9..476169398 100644 --- a/sdk/examples/services/metrics_service.go +++ b/sdk/examples/services/metrics_service.go @@ -4,13 +4,15 @@ import ( "sync" "github.com/nginx/agent/sdk/v2/proto" + f5_nginx_agent_sdk_events "github.com/nginx/agent/sdk/v2/proto/events" log "github.com/sirupsen/logrus" ) type MetricsGrpcService struct { sync.RWMutex - fromClient chan *proto.MetricsReport - reports []*proto.MetricsReport + fromClient chan *proto.MetricsReport + reports []*proto.MetricsReport + eventReports []*f5_nginx_agent_sdk_events.EventReport } func NewMetricsService() *MetricsGrpcService { @@ -36,6 +38,26 @@ func (grpcService *MetricsGrpcService) Stream(stream proto.MetricsService_Stream return nil } +func (grpcService *MetricsGrpcService) StreamEvents(stream proto.MetricsService_StreamEventsServer) error { + log.Trace("Event Report Channel") + + for { + report, err := stream.Recv() + if err != nil { + // recommend handling error + log.Debugf("Error in recvHandle %v", err) + break + } + log.Info("Got metrics") + grpcService.eventReports = append(grpcService.eventReports, report) + } + return nil +} + func (grpcService *MetricsGrpcService) GetMetrics() []*proto.MetricsReport { return grpcService.reports } + +func (grpcService *MetricsGrpcService) GetEventReports() []*f5_nginx_agent_sdk_events.EventReport { + return grpcService.eventReports +} diff --git a/sdk/proto/events/event.pb.go b/sdk/proto/events/event.pb.go index 00c7c1fb3..cab3f517d 100644 --- a/sdk/proto/events/event.pb.go +++ b/sdk/proto/events/event.pb.go @@ -363,6 +363,12 @@ type SecurityViolationEvent struct { BotSignatureName string `protobuf:"bytes,40,opt,name=BotSignatureName,proto3" json:"bot_signature_name"` ViolationContexts string `protobuf:"bytes,41,opt,name=ViolationContexts,proto3" json:"violation_contexts"` ViolationsData []*ViolationData `protobuf:"bytes,42,rep,name=ViolationsData,proto3" json:"violations_data"` + SystemID string `protobuf:"bytes,43,opt,name=SystemID,proto3" json:"system_id"` + Hostname string `protobuf:"bytes,44,opt,name=Hostname,proto3" json:"hostname"` + InstanceTags string `protobuf:"bytes,45,opt,name=InstanceTags,proto3" json:"instance_tags"` + InstanceGroup string `protobuf:"bytes,46,opt,name=InstanceGroup,proto3" json:"instance_group"` + DisplayName string `protobuf:"bytes,47,opt,name=DisplayName,proto3" json:"display_name"` + NginxID string `protobuf:"bytes,48,opt,name=NginxID,proto3" json:"nginx_id"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -695,11 +701,54 @@ func (m *SecurityViolationEvent) GetViolationsData() []*ViolationData { return nil } +func (m *SecurityViolationEvent) GetSystemID() string { + if m != nil { + return m.SystemID + } + return "" +} + +func (m *SecurityViolationEvent) GetHostname() string { + if m != nil { + return m.Hostname + } + return "" +} + +func (m *SecurityViolationEvent) GetInstanceTags() string { + if m != nil { + return m.InstanceTags + } + return "" +} + +func (m *SecurityViolationEvent) GetInstanceGroup() string { + if m != nil { + return m.InstanceGroup + } + return "" +} + +func (m *SecurityViolationEvent) GetDisplayName() string { + if m != nil { + return m.DisplayName + } + return "" +} + +func (m *SecurityViolationEvent) GetNginxID() string { + if m != nil { + return m.NginxID + } + return "" +} + type SignatureData struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"sig_data_id"` - Buffer string `protobuf:"bytes,2,opt,name=Buffer,proto3" json:"sig_data_buffer"` - Offset string `protobuf:"bytes,3,opt,name=Offset,proto3" json:"sig_data_offset"` - Length string `protobuf:"bytes,4,opt,name=Length,proto3" json:"sig_data_length"` + BlockingMask string `protobuf:"bytes,2,opt,name=BlockingMask,proto3" json:"sig_data_blocking_mask"` + Buffer string `protobuf:"bytes,3,opt,name=Buffer,proto3" json:"sig_data_buffer"` + Offset string `protobuf:"bytes,4,opt,name=Offset,proto3" json:"sig_data_offset"` + Length string `protobuf:"bytes,5,opt,name=Length,proto3" json:"sig_data_length"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -745,6 +794,13 @@ func (m *SignatureData) GetID() string { return "" } +func (m *SignatureData) GetBlockingMask() string { + if m != nil { + return m.BlockingMask + } + return "" +} + func (m *SignatureData) GetBuffer() string { if m != nil { return m.Buffer @@ -766,12 +822,66 @@ func (m *SignatureData) GetLength() string { return "" } +type ContextData struct { + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"parameter_data_name"` + Value string `protobuf:"bytes,2,opt,name=Value,proto3" json:"parameter_data_value"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ContextData) Reset() { *m = ContextData{} } +func (m *ContextData) String() string { return proto.CompactTextString(m) } +func (*ContextData) ProtoMessage() {} +func (*ContextData) Descriptor() ([]byte, []int) { + return fileDescriptor_2d17a9d3f0ddf27e, []int{6} +} +func (m *ContextData) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ContextData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ContextData.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ContextData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContextData.Merge(m, src) +} +func (m *ContextData) XXX_Size() int { + return m.Size() +} +func (m *ContextData) XXX_DiscardUnknown() { + xxx_messageInfo_ContextData.DiscardUnknown(m) +} + +var xxx_messageInfo_ContextData proto.InternalMessageInfo + +func (m *ContextData) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ContextData) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + type ViolationData struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"violation_data_name"` Context string `protobuf:"bytes,2,opt,name=Context,proto3" json:"violation_data_context"` - ParameterName string `protobuf:"bytes,3,opt,name=ParameterName,proto3" json:"violation_data_param_name"` - ParamaterValue string `protobuf:"bytes,4,opt,name=ParamaterValue,proto3" json:"violation_data_param_value"` - Signatures []*SignatureData `protobuf:"bytes,5,rep,name=Signatures,proto3" json:"violation_data_signatures"` + ContextData *ContextData `protobuf:"bytes,3,opt,name=ContextData,proto3" json:"violation_data_context_data"` + Signatures []*SignatureData `protobuf:"bytes,4,rep,name=Signatures,proto3" json:"violation_data_signatures"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -781,7 +891,7 @@ func (m *ViolationData) Reset() { *m = ViolationData{} } func (m *ViolationData) String() string { return proto.CompactTextString(m) } func (*ViolationData) ProtoMessage() {} func (*ViolationData) Descriptor() ([]byte, []int) { - return fileDescriptor_2d17a9d3f0ddf27e, []int{6} + return fileDescriptor_2d17a9d3f0ddf27e, []int{7} } func (m *ViolationData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -824,18 +934,11 @@ func (m *ViolationData) GetContext() string { return "" } -func (m *ViolationData) GetParameterName() string { - if m != nil { - return m.ParameterName - } - return "" -} - -func (m *ViolationData) GetParamaterValue() string { +func (m *ViolationData) GetContextData() *ContextData { if m != nil { - return m.ParamaterValue + return m.ContextData } - return "" + return nil } func (m *ViolationData) GetSignatures() []*SignatureData { @@ -852,115 +955,125 @@ func init() { proto.RegisterType((*ActivityEvent)(nil), "f5.nginx.agent.sdk.events.ActivityEvent") proto.RegisterType((*SecurityViolationEvent)(nil), "f5.nginx.agent.sdk.events.SecurityViolationEvent") proto.RegisterType((*SignatureData)(nil), "f5.nginx.agent.sdk.events.SignatureData") + proto.RegisterType((*ContextData)(nil), "f5.nginx.agent.sdk.events.ContextData") proto.RegisterType((*ViolationData)(nil), "f5.nginx.agent.sdk.events.ViolationData") } func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) } var fileDescriptor_2d17a9d3f0ddf27e = []byte{ - // 1620 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x57, 0xdd, 0x6e, 0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 0x84, 0x1e, 0x99, 0xcf, 0x17, 0xcb, 0xe5, 0x9c, 0x87, 0x70, 0x71, - 0xe2, 0x81, 0xf2, 0x49, 0x91, 0x7b, 0xd8, 0x2a, 0x03, 0x87, 0xd2, 0xeb, 0x02, 0xfc, 0x13, 0x22, - 0xd7, 0x8c, 0xe7, 0x2c, 0xd5, 0x7f, 0x39, 0xc8, 0x11, 0x38, 0x3b, 0x2c, 0x72, 0xef, 0xe0, 0xba, - 0x33, 0x7f, 0x65, 0x58, 0xf4, 0x56, 0xbd, 0xde, 0x7a, 0x13, 0xb6, 0x62, 0xfa, 0xef, 0x0e, 0xf9, - 0x55, 0xed, 0xfa, 0xd6, 0x46, 0x2b, 0x14, 0x7a, 0xc4, 0xfe, 0x7e, 0x13, 0x4c, 0xd9, 0x9c, 0x74, - 0x6b, 0x3d, 0x62, 0x01, 0x7f, 0xae, 0x11, 0xda, 0x24, 0x9a, 0xcd, 0xca, 0x05, 0xc4, 0x78, 0x5e, - 0xdf, 0xac, 0xc6, 0x46, 0x2b, 0x14, 0xff, 0x19, 0xed, 0x9d, 0x5d, 0xa4, 0x2c, 0x50, 0xc3, 0x60, - 0xb1, 0x0c, 0x78, 0x9c, 0x98, 0x42, 0x7e, 0x01, 0xa2, 0xfd, 0x22, 0xf7, 0x3e, 0x53, 0x00, 0xfb, - 0xa1, 0xc5, 0x6d, 0x41, 0x6f, 0x52, 0xe9, 0x6d, 0x31, 0x10, 0xea, 0x45, 0x22, 0x16, 0xc1, 0x9c, - 0x33, 0x49, 0xbe, 0x74, 0xed, 0x30, 0x15, 0xca, 0x0f, 0x4a, 0x80, 0x36, 0x68, 0xba, 0xce, 0x03, - 0xa1, 0xaa, 0xe7, 0xde, 0x57, 0xae, 0xce, 0x5a, 0x55, 0x3d, 0xf9, 0xea, 0x24, 0xfc, 0x03, 0x7a, - 0xfc, 0x32, 0x99, 0x89, 0x34, 0x64, 0x51, 0x23, 0xe4, 0xaf, 0x41, 0x7c, 0x50, 0xe4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x2a, 0x06, 0x24, 0xfc, 0x7b, 0xb4, 0x65, 0x73, 0x6d, 0xaf, 0x01, 0xcd, - 0x72, 0x85, 0x6f, 0x0b, 0x44, 0x4b, 0x2a, 0x1e, 0xa2, 0xce, 0x69, 0x90, 0x06, 0x0b, 0xa6, 0x58, - 0x0a, 0xb1, 0xd6, 0xdd, 0xf3, 0xe8, 0x8a, 0x76, 0xa9, 0x79, 0x26, 0x62, 0x53, 0x83, 0x5f, 0xa1, - 0x5d, 0x30, 0x04, 0xaa, 0x7c, 0xbc, 0x6c, 0xb8, 0x65, 0x72, 0xa3, 0x17, 0xf3, 0x8c, 0xb9, 0xa2, - 0xc2, 0x31, 0x42, 0x55, 0xe9, 0x24, 0xb9, 0xf7, 0x7f, 0xdb, 0xa3, 0x51, 0xe7, 0x1b, 0xcf, 0x5c, - 0xf5, 0xb6, 0xa4, 0x35, 0xd7, 0x03, 0xfa, 0xf3, 0xa7, 0xc3, 0xd6, 0xc7, 0x4f, 0x87, 0xad, 0x7f, - 0x7f, 0x3a, 0x6c, 0xfd, 0x34, 0x8a, 0xb9, 0xba, 0xc8, 0xa6, 0xfa, 0x9d, 0xdd, 0x87, 0x48, 0x7d, - 0x88, 0xd4, 0x97, 0xd1, 0xfb, 0xfe, 0xea, 0xc4, 0xfc, 0x0f, 0xb8, 0x6f, 0x42, 0xfe, 0xf1, 0xd6, - 0xc3, 0x4c, 0x37, 0x81, 0xf7, 0xed, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, 0x39, 0xb9, 0x5d, - 0x6d, 0x0f, 0x00, 0x00, + // 1768 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x58, 0xdd, 0x6e, 0xdb, 0xc8, + 0x15, 0xae, 0x6c, 0xc7, 0x3f, 0x23, 0x3b, 0x3f, 0x63, 0x6f, 0x32, 0xf6, 0x66, 0x4d, 0x57, 0xd9, + 0x4d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0xbf, 0x39, 0x82, 0x91, 0x5a, + 0xa3, 0x78, 0x31, 0x42, 0x55, 0x13, 0x49, 0xb2, 0xf4, 0x7f, 0xa5, 0xdc, 0xe8, 0x38, 0xb3, 0x7e, + 0x5f, 0x89, 0x55, 0xcd, 0x21, 0x49, 0x6b, 0x47, 0xf7, 0xe9, 0xcf, 0x9f, 0x76, 0x5b, 0x1f, 0x3f, + 0xed, 0xb6, 0xfe, 0xf3, 0x69, 0xb7, 0xf5, 0xd3, 0x20, 0xe6, 0xea, 0x3c, 0x3b, 0xd3, 0x7f, 0x13, + 0xf5, 0x20, 0x52, 0x0f, 0x22, 0xf5, 0x64, 0x74, 0xd1, 0x9b, 0x1f, 0x98, 0xff, 0xad, 0xe8, 0x99, + 0x90, 0x7f, 0xbc, 0xf5, 0x65, 0xce, 0x96, 0x81, 0xf7, 0xed, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, + 0x48, 0x0a, 0x71, 0xa1, 0x19, 0x11, 0x00, 0x00, } func (m *Metadata) Marshal() (dAtA []byte, err error) { @@ -1247,6 +1360,60 @@ func (m *SecurityViolationEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.NginxID) > 0 { + i -= len(m.NginxID) + copy(dAtA[i:], m.NginxID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.NginxID))) + i-- + dAtA[i] = 0x3 + i-- + dAtA[i] = 0x82 + } + if len(m.DisplayName) > 0 { + i -= len(m.DisplayName) + copy(dAtA[i:], m.DisplayName) + i = encodeVarintEvent(dAtA, i, uint64(len(m.DisplayName))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xfa + } + if len(m.InstanceGroup) > 0 { + i -= len(m.InstanceGroup) + copy(dAtA[i:], m.InstanceGroup) + i = encodeVarintEvent(dAtA, i, uint64(len(m.InstanceGroup))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xf2 + } + if len(m.InstanceTags) > 0 { + i -= len(m.InstanceTags) + copy(dAtA[i:], m.InstanceTags) + i = encodeVarintEvent(dAtA, i, uint64(len(m.InstanceTags))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xea + } + if len(m.Hostname) > 0 { + i -= len(m.Hostname) + copy(dAtA[i:], m.Hostname) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Hostname))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xe2 + } + if len(m.SystemID) > 0 { + i -= len(m.SystemID) + copy(dAtA[i:], m.SystemID) + i = encodeVarintEvent(dAtA, i, uint64(len(m.SystemID))) + i-- + dAtA[i] = 0x2 + i-- + dAtA[i] = 0xda + } if len(m.ViolationsData) > 0 { for iNdEx := len(m.ViolationsData) - 1; iNdEx >= 0; iNdEx-- { { @@ -1634,20 +1801,27 @@ func (m *SignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Length) i = encodeVarintEvent(dAtA, i, uint64(len(m.Length))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } if len(m.Offset) > 0 { i -= len(m.Offset) copy(dAtA[i:], m.Offset) i = encodeVarintEvent(dAtA, i, uint64(len(m.Offset))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(m.Buffer) > 0 { i -= len(m.Buffer) copy(dAtA[i:], m.Buffer) i = encodeVarintEvent(dAtA, i, uint64(len(m.Buffer))) i-- + dAtA[i] = 0x1a + } + if len(m.BlockingMask) > 0 { + i -= len(m.BlockingMask) + copy(dAtA[i:], m.BlockingMask) + i = encodeVarintEvent(dAtA, i, uint64(len(m.BlockingMask))) + i-- dAtA[i] = 0x12 } if len(m.ID) > 0 { @@ -1660,6 +1834,47 @@ func (m *SignatureData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ContextData) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContextData) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContextData) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEvent(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ViolationData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1695,20 +1910,18 @@ func (m *ViolationData) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintEvent(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } } - if len(m.ParamaterValue) > 0 { - i -= len(m.ParamaterValue) - copy(dAtA[i:], m.ParamaterValue) - i = encodeVarintEvent(dAtA, i, uint64(len(m.ParamaterValue))) - i-- - dAtA[i] = 0x22 - } - if len(m.ParameterName) > 0 { - i -= len(m.ParameterName) - copy(dAtA[i:], m.ParameterName) - i = encodeVarintEvent(dAtA, i, uint64(len(m.ParameterName))) + if m.ContextData != nil { + { + size, err := m.ContextData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvent(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x1a } @@ -2039,6 +2252,30 @@ func (m *SecurityViolationEvent) Size() (n int) { n += 2 + l + sovEvent(uint64(l)) } } + l = len(m.SystemID) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.Hostname) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.InstanceTags) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.InstanceGroup) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.DisplayName) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } + l = len(m.NginxID) + if l > 0 { + n += 2 + l + sovEvent(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2055,6 +2292,10 @@ func (m *SignatureData) Size() (n int) { if l > 0 { n += 1 + l + sovEvent(uint64(l)) } + l = len(m.BlockingMask) + if l > 0 { + n += 1 + l + sovEvent(uint64(l)) + } l = len(m.Buffer) if l > 0 { n += 1 + l + sovEvent(uint64(l)) @@ -2073,7 +2314,7 @@ func (m *SignatureData) Size() (n int) { return n } -func (m *ViolationData) Size() (n int) { +func (m *ContextData) Size() (n int) { if m == nil { return 0 } @@ -2083,18 +2324,34 @@ func (m *ViolationData) Size() (n int) { if l > 0 { n += 1 + l + sovEvent(uint64(l)) } - l = len(m.Context) + l = len(m.Value) if l > 0 { n += 1 + l + sovEvent(uint64(l)) } - l = len(m.ParameterName) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ViolationData) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) if l > 0 { n += 1 + l + sovEvent(uint64(l)) } - l = len(m.ParamaterValue) + l = len(m.Context) if l > 0 { n += 1 + l + sovEvent(uint64(l)) } + if m.ContextData != nil { + l = m.ContextData.Size() + n += 1 + l + sovEvent(uint64(l)) + } if len(m.Signatures) > 0 { for _, e := range m.Signatures { l = e.Size() @@ -4126,6 +4383,198 @@ func (m *SecurityViolationEvent) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 43: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SystemID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SystemID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 44: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hostname", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hostname = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 45: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstanceTags", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InstanceTags = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 46: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstanceGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InstanceGroup = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 47: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DisplayName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DisplayName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 48: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NginxID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NginxID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvent(dAtA[iNdEx:]) @@ -4210,6 +4659,38 @@ func (m *SignatureData) Unmarshal(dAtA []byte) error { m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockingMask", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockingMask = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Buffer", wireType) } @@ -4241,7 +4722,7 @@ func (m *SignatureData) Unmarshal(dAtA []byte) error { } m.Buffer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Offset", wireType) } @@ -4273,7 +4754,7 @@ func (m *SignatureData) Unmarshal(dAtA []byte) error { } m.Offset = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) } @@ -4327,7 +4808,7 @@ func (m *SignatureData) Unmarshal(dAtA []byte) error { } return nil } -func (m *ViolationData) Unmarshal(dAtA []byte) error { +func (m *ContextData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4350,10 +4831,10 @@ func (m *ViolationData) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ViolationData: wiretype end group for non-group") + return fmt.Errorf("proto: ContextData: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ViolationData: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ContextData: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4390,7 +4871,7 @@ func (m *ViolationData) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4418,11 +4899,62 @@ func (m *ViolationData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Context = string(dAtA[iNdEx:postIndex]) + m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + default: + iNdEx = preIndex + skippy, err := skipEvent(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvent + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ViolationData) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ViolationData: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ViolationData: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParameterName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4450,11 +4982,11 @@ func (m *ViolationData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ParameterName = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParamaterValue", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4482,9 +5014,45 @@ func (m *ViolationData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ParamaterValue = string(dAtA[iNdEx:postIndex]) + m.Context = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContextData", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvent + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvent + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvent + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContextData == nil { + m.ContextData = &ContextData{} + } + if err := m.ContextData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) } diff --git a/sdk/proto/events/event.proto b/sdk/proto/events/event.proto index 143cb259e..f866e640a 100644 --- a/sdk/proto/events/event.proto +++ b/sdk/proto/events/event.proto @@ -50,21 +50,21 @@ message SecurityViolationEvent { string DateTime = 1 [(gogoproto.jsontag) = "date_time" ]; string PolicyName = 2 [(gogoproto.jsontag) = "policy_name" ]; string SupportID = 3 [(gogoproto.jsontag) = "support_id" ]; - + string Outcome = 4 [(gogoproto.jsontag) = "outcome" ]; string OutcomeReason = 5 [(gogoproto.jsontag) = "outcome_reason" ]; string BlockingExceptionReason = 6 [(gogoproto.jsontag) = "blocking_exception_reason" ]; - + string Method = 7 [(gogoproto.jsontag) = "method" ]; string Protocol = 8 [(gogoproto.jsontag) = "protocol" ]; string XForwardedForHeaderValue = 9 [(gogoproto.jsontag) = "xff_header_value" ]; - + string URI = 10 [(gogoproto.jsontag) = "uri" ]; string Request = 11 [(gogoproto.jsontag) = "request" ]; string IsTruncated = 12 [(gogoproto.jsontag) = "is_truncated" ]; string RequestStatus = 13 [(gogoproto.jsontag) = "request_status" ]; string ResponseCode = 14 [(gogoproto.jsontag) = "response_code" ]; - + string GeoIP = 15 [(gogoproto.jsontag) = "geo_ip" ]; string Host = 16 [(gogoproto.jsontag) = "host" ]; string UnitHostname = 17 [(gogoproto.jsontag) = "unit_hostname" ]; @@ -73,47 +73,59 @@ message SecurityViolationEvent { string IPClient = 20 [(gogoproto.jsontag) = "ip_client" ]; string DestinationPort = 21 [(gogoproto.jsontag) = "destination_port" ]; string SourcePort = 22 [(gogoproto.jsontag) = "source_port" ]; - + string Violations = 23 [(gogoproto.jsontag) = "violations" ]; string SubViolations = 24 [(gogoproto.jsontag) = "sub_violations" ]; string ViolationRating = 25 [(gogoproto.jsontag) = "violation_rating" ]; - + string SigID = 26 [(gogoproto.jsontag) = "sig_id" ]; string SigNames = 27 [(gogoproto.jsontag) = "sig_names" ]; string SigSetNames = 28 [(gogoproto.jsontag) = "sig_set_names" ]; string SigCVEs = 29 [(gogoproto.jsontag) = "sig_cves" ]; - + string ClientClass = 30 [(gogoproto.jsontag) = "client_class" ]; string ClientApplication = 31 [(gogoproto.jsontag) = "client_application" ]; string ClientApplicationVersion = 32 [(gogoproto.jsontag) = "client_application_version" ]; - + string Severity = 33 [(gogoproto.jsontag) = "severity" ]; // NOTE: Severity Label might be deprecated if we have no use for it string SeverityLabel = 34 [(gogoproto.jsontag) = "severity_label" ]; string Priority = 35 [(gogoproto.jsontag) = "priority" ]; - + string ThreatCampaignNames = 36 [(gogoproto.jsontag) = "threat_campaign_names" ]; - + string BotAnomalies = 37 [(gogoproto.jsontag) = "bot_anomalies" ]; string BotCategory = 38 [(gogoproto.jsontag) = "bot_category" ]; string EnforcedBotAnomalies = 39 [(gogoproto.jsontag) = "enforced_bot_anomalies" ]; string BotSignatureName = 40 [(gogoproto.jsontag) = "bot_signature_name" ]; - + string ViolationContexts = 41 [(gogoproto.jsontag) = "violation_contexts" ]; repeated ViolationData ViolationsData = 42 [(gogoproto.jsontag) = "violations_data" ]; + + string SystemID = 43 [(gogoproto.jsontag) = "system_id" ]; + string Hostname = 44 [(gogoproto.jsontag) = "hostname" ]; + string InstanceTags = 45 [(gogoproto.jsontag) = "instance_tags" ]; + string InstanceGroup = 46 [(gogoproto.jsontag) = "instance_group" ]; + string DisplayName = 47 [(gogoproto.jsontag) = "display_name" ]; + string NginxID = 48 [(gogoproto.jsontag) = "nginx_id" ]; } - + message SignatureData { string ID = 1 [(gogoproto.jsontag) = "sig_data_id" ]; - string Buffer = 2 [(gogoproto.jsontag) = "sig_data_buffer" ]; - string Offset = 3 [(gogoproto.jsontag) = "sig_data_offset" ]; - string Length = 4 [(gogoproto.jsontag) = "sig_data_length" ]; + string BlockingMask = 2 [(gogoproto.jsontag) = "sig_data_blocking_mask" ]; + string Buffer = 3 [(gogoproto.jsontag) = "sig_data_buffer" ]; + string Offset = 4 [(gogoproto.jsontag) = "sig_data_offset" ]; + string Length = 5 [(gogoproto.jsontag) = "sig_data_length" ]; } - + +message ContextData { + string Name = 1 [(gogoproto.jsontag) = "parameter_data_name"]; + string Value = 2 [(gogoproto.jsontag) = "parameter_data_value"]; +} + message ViolationData { string Name = 1 [(gogoproto.jsontag) = "violation_data_name" ]; string Context = 2 [(gogoproto.jsontag) = "violation_data_context" ]; - string ParameterName = 3 [(gogoproto.jsontag) = "violation_data_param_name" ]; - string ParamaterValue = 4 [(gogoproto.jsontag) = "violation_data_param_value" ]; - repeated SignatureData Signatures = 5 [(gogoproto.jsontag) = "violation_data_signatures" ]; -} \ No newline at end of file + ContextData ContextData = 3 [(gogoproto.jsontag) = "violation_data_context_data" ]; + repeated SignatureData Signatures = 4 [(gogoproto.jsontag) = "violation_data_signatures" ]; +} diff --git a/sdk/proto/ingest_svc.pb.go b/sdk/proto/ingest_svc.pb.go deleted file mode 100644 index 654309820..000000000 --- a/sdk/proto/ingest_svc.pb.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: ingest_svc.proto - -package proto - -import ( - context "context" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - events "github.com/nginx/agent/sdk/v2/proto/events" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -func init() { proto.RegisterFile("ingest_svc.proto", fileDescriptor_e87a1d7991134362) } - -var fileDescriptor_e87a1d7991134362 = []byte{ - // 232 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0xcc, 0x4b, 0x4f, - 0x2d, 0x2e, 0x89, 0x2f, 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4a, 0x33, - 0xd5, 0xcb, 0x4b, 0xcf, 0xcc, 0xab, 0xd0, 0x4b, 0x4c, 0x4f, 0xcd, 0x2b, 0xd1, 0x2b, 0x4e, 0xc9, - 0x96, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xab, 0x48, 0x2a, 0x4d, 0xd3, 0x4f, - 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0xcd, 0x4d, 0x2d, 0x29, 0xca, 0x4c, 0x2e, 0x86, - 0x72, 0x85, 0x52, 0xcb, 0x52, 0xf3, 0x4a, 0x8a, 0xf5, 0xc1, 0x14, 0x44, 0xcc, 0x68, 0x27, 0x23, - 0x17, 0x87, 0x27, 0xd8, 0xa2, 0xd4, 0x22, 0xa1, 0x10, 0x2e, 0xe1, 0xe0, 0x92, 0xa2, 0xd4, 0xc4, - 0x5c, 0x5f, 0x88, 0xbe, 0xa0, 0xd4, 0x82, 0xfc, 0xa2, 0x12, 0x21, 0x45, 0x3d, 0x4c, 0x8b, 0xf5, - 0x50, 0x94, 0x48, 0x89, 0xe9, 0x41, 0xdc, 0xa1, 0x07, 0x73, 0x87, 0x9e, 0x2b, 0xc8, 0x1d, 0x4a, - 0x0c, 0x1a, 0x8c, 0x42, 0xe1, 0x5c, 0x82, 0x10, 0x53, 0x5d, 0x41, 0xf6, 0x42, 0xcd, 0x54, 0xc3, - 0x66, 0x26, 0xc4, 0x7d, 0x7a, 0x48, 0xea, 0xf0, 0x19, 0xec, 0x64, 0x7e, 0xe2, 0x91, 0x1c, 0xe3, - 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x46, 0x69, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, - 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0x0d, 0xd6, 0x07, 0x1b, 0xac, 0x5f, 0x9c, 0x92, 0xad, 0x5f, - 0x66, 0x04, 0x09, 0x20, 0x6b, 0x88, 0x29, 0x6c, 0x60, 0xca, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, - 0x56, 0x21, 0x22, 0x28, 0x63, 0x01, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// IngesterClient is the client API for Ingester service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type IngesterClient interface { - // A client-to-server streaming RPC to deliver high volume metrics reports. - StreamMetricsReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamMetricsReportClient, error) - // A client-to-server streaming RPC to deliver high volume event reports. - StreamEventReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamEventReportClient, error) -} - -type ingesterClient struct { - cc *grpc.ClientConn -} - -func NewIngesterClient(cc *grpc.ClientConn) IngesterClient { - return &ingesterClient{cc} -} - -func (c *ingesterClient) StreamMetricsReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamMetricsReportClient, error) { - stream, err := c.cc.NewStream(ctx, &_Ingester_serviceDesc.Streams[0], "/f5.nginx.agent.sdk.Ingester/StreamMetricsReport", opts...) - if err != nil { - return nil, err - } - x := &ingesterStreamMetricsReportClient{stream} - return x, nil -} - -type Ingester_StreamMetricsReportClient interface { - Send(*MetricsReport) error - CloseAndRecv() (*types.Empty, error) - grpc.ClientStream -} - -type ingesterStreamMetricsReportClient struct { - grpc.ClientStream -} - -func (x *ingesterStreamMetricsReportClient) Send(m *MetricsReport) error { - return x.ClientStream.SendMsg(m) -} - -func (x *ingesterStreamMetricsReportClient) CloseAndRecv() (*types.Empty, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(types.Empty) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *ingesterClient) StreamEventReport(ctx context.Context, opts ...grpc.CallOption) (Ingester_StreamEventReportClient, error) { - stream, err := c.cc.NewStream(ctx, &_Ingester_serviceDesc.Streams[1], "/f5.nginx.agent.sdk.Ingester/StreamEventReport", opts...) - if err != nil { - return nil, err - } - x := &ingesterStreamEventReportClient{stream} - return x, nil -} - -type Ingester_StreamEventReportClient interface { - Send(*events.EventReport) error - CloseAndRecv() (*types.Empty, error) - grpc.ClientStream -} - -type ingesterStreamEventReportClient struct { - grpc.ClientStream -} - -func (x *ingesterStreamEventReportClient) Send(m *events.EventReport) error { - return x.ClientStream.SendMsg(m) -} - -func (x *ingesterStreamEventReportClient) CloseAndRecv() (*types.Empty, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(types.Empty) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -// IngesterServer is the server API for Ingester service. -type IngesterServer interface { - // A client-to-server streaming RPC to deliver high volume metrics reports. - StreamMetricsReport(Ingester_StreamMetricsReportServer) error - // A client-to-server streaming RPC to deliver high volume event reports. - StreamEventReport(Ingester_StreamEventReportServer) error -} - -// UnimplementedIngesterServer can be embedded to have forward compatible implementations. -type UnimplementedIngesterServer struct { -} - -func (*UnimplementedIngesterServer) StreamMetricsReport(srv Ingester_StreamMetricsReportServer) error { - return status.Errorf(codes.Unimplemented, "method StreamMetricsReport not implemented") -} -func (*UnimplementedIngesterServer) StreamEventReport(srv Ingester_StreamEventReportServer) error { - return status.Errorf(codes.Unimplemented, "method StreamEventReport not implemented") -} - -func RegisterIngesterServer(s *grpc.Server, srv IngesterServer) { - s.RegisterService(&_Ingester_serviceDesc, srv) -} - -func _Ingester_StreamMetricsReport_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(IngesterServer).StreamMetricsReport(&ingesterStreamMetricsReportServer{stream}) -} - -type Ingester_StreamMetricsReportServer interface { - SendAndClose(*types.Empty) error - Recv() (*MetricsReport, error) - grpc.ServerStream -} - -type ingesterStreamMetricsReportServer struct { - grpc.ServerStream -} - -func (x *ingesterStreamMetricsReportServer) SendAndClose(m *types.Empty) error { - return x.ServerStream.SendMsg(m) -} - -func (x *ingesterStreamMetricsReportServer) Recv() (*MetricsReport, error) { - m := new(MetricsReport) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Ingester_StreamEventReport_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(IngesterServer).StreamEventReport(&ingesterStreamEventReportServer{stream}) -} - -type Ingester_StreamEventReportServer interface { - SendAndClose(*types.Empty) error - Recv() (*events.EventReport, error) - grpc.ServerStream -} - -type ingesterStreamEventReportServer struct { - grpc.ServerStream -} - -func (x *ingesterStreamEventReportServer) SendAndClose(m *types.Empty) error { - return x.ServerStream.SendMsg(m) -} - -func (x *ingesterStreamEventReportServer) Recv() (*events.EventReport, error) { - m := new(events.EventReport) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -var _Ingester_serviceDesc = grpc.ServiceDesc{ - ServiceName: "f5.nginx.agent.sdk.Ingester", - HandlerType: (*IngesterServer)(nil), - Methods: []grpc.MethodDesc{}, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamMetricsReport", - Handler: _Ingester_StreamMetricsReport_Handler, - ClientStreams: true, - }, - { - StreamName: "StreamEventReport", - Handler: _Ingester_StreamEventReport_Handler, - ClientStreams: true, - }, - }, - Metadata: "ingest_svc.proto", -} diff --git a/sdk/proto/ingest_svc.proto b/sdk/proto/ingest_svc.proto deleted file mode 100644 index 9c362e739..000000000 --- a/sdk/proto/ingest_svc.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package f5.nginx.agent.sdk; -option go_package = "github.com/nginx/agent/sdk/v2/proto;proto"; - -import "google/protobuf/empty.proto"; -import "metrics.proto"; -import "events/event.proto"; - -// Ingester is responsible for ingesting high volume metrics and events -service Ingester { - // A client-to-server streaming RPC to deliver high volume metrics reports. - rpc StreamMetricsReport(stream MetricsReport) returns (google.protobuf.Empty) {} - - // A client-to-server streaming RPC to deliver high volume event reports. - rpc StreamEventReport(stream f5.nginx.agent.sdk.events.EventReport) returns (google.protobuf.Empty) {} -} diff --git a/sdk/proto/metrics.svc.pb.go b/sdk/proto/metrics.svc.pb.go index 698ca65fe..f86abcd9f 100644 --- a/sdk/proto/metrics.svc.pb.go +++ b/sdk/proto/metrics.svc.pb.go @@ -8,6 +8,7 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" + events "github.com/nginx/agent/sdk/v2/proto/events" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -28,20 +29,22 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("metrics.svc.proto", fileDescriptor_ece8a4321458910f) } var fileDescriptor_ece8a4321458910f = []byte{ - // 199 bytes of a gzipped FileDescriptorProto + // 229 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcc, 0x4d, 0x2d, 0x29, 0xca, 0x4c, 0x2e, 0xd6, 0x2b, 0x2e, 0x4b, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4a, 0x33, 0xd5, 0xcb, 0x4b, 0xcf, 0xcc, 0xab, 0xd0, 0x4b, 0x4c, 0x4f, 0xcd, 0x2b, 0xd1, 0x2b, 0x4e, 0xc9, 0x96, 0x92, 0x4e, 0xcf, 0xcf, 0x4f, 0xcf, 0x49, 0xd5, 0x07, 0xab, 0x48, 0x2a, 0x4d, 0xd3, - 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0xe2, 0x85, 0x99, 0x01, 0xe6, 0x1a, 0xc5, 0x71, - 0xf1, 0xf9, 0x42, 0x04, 0x82, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0x85, 0xdc, 0xb9, 0xd8, 0x82, - 0x4b, 0x8a, 0x52, 0x13, 0x73, 0x85, 0x14, 0xf5, 0x30, 0x0d, 0xd7, 0x83, 0xaa, 0x0e, 0x4a, 0x2d, - 0xc8, 0x2f, 0x2a, 0x91, 0x12, 0xd3, 0x83, 0xd8, 0xa5, 0x07, 0xb3, 0x4b, 0xcf, 0x15, 0x64, 0x97, - 0x12, 0x83, 0x06, 0xa3, 0x14, 0x73, 0x07, 0x13, 0xa3, 0x93, 0xf9, 0x89, 0x47, 0x72, 0x8c, 0x17, - 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x18, 0xa5, 0x99, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, - 0x97, 0x9c, 0x9f, 0xab, 0x0f, 0x36, 0x58, 0x1f, 0x6c, 0xb0, 0x7e, 0x71, 0x4a, 0xb6, 0x7e, 0x99, - 0x11, 0xc4, 0xc1, 0xd6, 0x10, 0xa3, 0xd8, 0xc0, 0x94, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x04, - 0x53, 0x50, 0x03, 0xf4, 0x00, 0x00, 0x00, + 0x4f, 0xcd, 0x2d, 0x28, 0xa9, 0x84, 0x68, 0x90, 0x12, 0x4a, 0x2d, 0x4b, 0xcd, 0x2b, 0x29, 0xd6, + 0x07, 0x53, 0x50, 0x31, 0x5e, 0x98, 0xb9, 0x60, 0xae, 0xd1, 0x5a, 0x46, 0x2e, 0x3e, 0x5f, 0x88, + 0x48, 0x70, 0x6a, 0x51, 0x59, 0x66, 0x72, 0xaa, 0x90, 0x3b, 0x17, 0x5b, 0x70, 0x49, 0x51, 0x6a, + 0x62, 0xae, 0x90, 0xa2, 0x1e, 0xa6, 0x8d, 0x7a, 0x50, 0xd5, 0x41, 0xa9, 0x05, 0xf9, 0x45, 0x25, + 0x52, 0x62, 0x7a, 0x10, 0x07, 0xe8, 0xc1, 0x1c, 0xa0, 0xe7, 0x0a, 0x72, 0x80, 0x12, 0x83, 0x06, + 0xa3, 0x50, 0x10, 0x17, 0x0f, 0xc4, 0x20, 0x57, 0xb0, 0x33, 0x84, 0xd4, 0xb0, 0x19, 0x07, 0x71, + 0xa2, 0x1e, 0x58, 0x09, 0x61, 0x33, 0x9d, 0xcc, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, + 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x28, 0xcd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, + 0x5c, 0x7d, 0xb0, 0xc1, 0xfa, 0x60, 0x83, 0xf5, 0x8b, 0x53, 0xb2, 0xf5, 0xcb, 0x8c, 0x20, 0x81, + 0x62, 0x0d, 0x31, 0x85, 0x0d, 0x4c, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xc4, 0x8d, + 0xf5, 0x58, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -55,18 +58,17 @@ const _ = grpc.SupportPackageIsVersion4 // MetricsServiceClient is the client API for MetricsService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -// -// Deprecated: Do not use. type MetricsServiceClient interface { // A client-to-server streaming RPC to deliver high volume metrics reports. Stream(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamClient, error) + // A client-to-server streaming RPC to deliver high volume event reports. + StreamEvents(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamEventsClient, error) } type metricsServiceClient struct { cc *grpc.ClientConn } -// Deprecated: Do not use. func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient { return &metricsServiceClient{cc} } @@ -105,15 +107,48 @@ func (x *metricsServiceStreamClient) CloseAndRecv() (*types.Empty, error) { return m, nil } +func (c *metricsServiceClient) StreamEvents(ctx context.Context, opts ...grpc.CallOption) (MetricsService_StreamEventsClient, error) { + stream, err := c.cc.NewStream(ctx, &_MetricsService_serviceDesc.Streams[1], "/f5.nginx.agent.sdk.MetricsService/StreamEvents", opts...) + if err != nil { + return nil, err + } + x := &metricsServiceStreamEventsClient{stream} + return x, nil +} + +type MetricsService_StreamEventsClient interface { + Send(*events.EventReport) error + CloseAndRecv() (*types.Empty, error) + grpc.ClientStream +} + +type metricsServiceStreamEventsClient struct { + grpc.ClientStream +} + +func (x *metricsServiceStreamEventsClient) Send(m *events.EventReport) error { + return x.ClientStream.SendMsg(m) +} + +func (x *metricsServiceStreamEventsClient) CloseAndRecv() (*types.Empty, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(types.Empty) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // MetricsServiceServer is the server API for MetricsService service. -// -// Deprecated: Do not use. type MetricsServiceServer interface { // A client-to-server streaming RPC to deliver high volume metrics reports. Stream(MetricsService_StreamServer) error + // A client-to-server streaming RPC to deliver high volume event reports. + StreamEvents(MetricsService_StreamEventsServer) error } -// Deprecated: Do not use. // UnimplementedMetricsServiceServer can be embedded to have forward compatible implementations. type UnimplementedMetricsServiceServer struct { } @@ -121,8 +156,10 @@ type UnimplementedMetricsServiceServer struct { func (*UnimplementedMetricsServiceServer) Stream(srv MetricsService_StreamServer) error { return status.Errorf(codes.Unimplemented, "method Stream not implemented") } +func (*UnimplementedMetricsServiceServer) StreamEvents(srv MetricsService_StreamEventsServer) error { + return status.Errorf(codes.Unimplemented, "method StreamEvents not implemented") +} -// Deprecated: Do not use. func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) { s.RegisterService(&_MetricsService_serviceDesc, srv) } @@ -153,6 +190,32 @@ func (x *metricsServiceStreamServer) Recv() (*MetricsReport, error) { return m, nil } +func _MetricsService_StreamEvents_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(MetricsServiceServer).StreamEvents(&metricsServiceStreamEventsServer{stream}) +} + +type MetricsService_StreamEventsServer interface { + SendAndClose(*types.Empty) error + Recv() (*events.EventReport, error) + grpc.ServerStream +} + +type metricsServiceStreamEventsServer struct { + grpc.ServerStream +} + +func (x *metricsServiceStreamEventsServer) SendAndClose(m *types.Empty) error { + return x.ServerStream.SendMsg(m) +} + +func (x *metricsServiceStreamEventsServer) Recv() (*events.EventReport, error) { + m := new(events.EventReport) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + var _MetricsService_serviceDesc = grpc.ServiceDesc{ ServiceName: "f5.nginx.agent.sdk.MetricsService", HandlerType: (*MetricsServiceServer)(nil), @@ -163,6 +226,11 @@ var _MetricsService_serviceDesc = grpc.ServiceDesc{ Handler: _MetricsService_Stream_Handler, ClientStreams: true, }, + { + StreamName: "StreamEvents", + Handler: _MetricsService_StreamEvents_Handler, + ClientStreams: true, + }, }, Metadata: "metrics.svc.proto", } diff --git a/sdk/proto/metrics.svc.proto b/sdk/proto/metrics.svc.proto index 62488ac44..81959dda8 100644 --- a/sdk/proto/metrics.svc.proto +++ b/sdk/proto/metrics.svc.proto @@ -3,12 +3,14 @@ package f5.nginx.agent.sdk; option go_package = "github.com/nginx/agent/sdk/v2/proto;proto"; import "google/protobuf/empty.proto"; +import "events/event.proto"; import "metrics.proto"; -// Interface exported by the server. +// MetricsService is responsible for ingesting high volume metrics and events service MetricsService { - option deprecated = true; - // A client-to-server streaming RPC to deliver high volume metrics reports. rpc Stream(stream MetricsReport) returns (google.protobuf.Empty) {} + + // A client-to-server streaming RPC to deliver high volume event reports. + rpc StreamEvents(stream f5.nginx.agent.sdk.events.EventReport) returns (google.protobuf.Empty) {} } diff --git a/src/core/config/config.go b/src/core/config/config.go index 9e7d36007..1d89affea 100644 --- a/src/core/config/config.go +++ b/src/core/config/config.go @@ -86,6 +86,15 @@ func SetNginxAppProtectDefaults() { Viper.SetDefault(NginxAppProtectReportInterval, Defaults.NginxAppProtect.ReportInterval) } +func SetNAPMonitoringDefaults() { + Viper.SetDefault(NAPMonitoringCollectorBufferSize, Defaults.NAPMonitoring.CollectorBufferSize) + Viper.SetDefault(NAPMonitoringProcessorBufferSize, Defaults.NAPMonitoring.ProcessorBufferSize) + Viper.SetDefault(NAPMonitoringSyslogIP, Defaults.NAPMonitoring.SyslogIP) + Viper.SetDefault(NAPMonitoringSyslogPort, Defaults.NAPMonitoring.SyslogPort) + Viper.SetDefault(NAPMonitoringReportInterval, Defaults.NAPMonitoring.ReportInterval) + Viper.SetDefault(NAPMonitoringReportCount, Defaults.NAPMonitoring.ReportCount) +} + func setFlagDeprecated(name string, usageMessage string) { err := ROOT_COMMAND.Flags().MarkDeprecated(name, usageMessage) if err != nil { @@ -176,6 +185,7 @@ func GetConfig(clientId string) (*Config, error) { InstanceGroup: Viper.GetString(InstanceGroupKey), AdvancedMetrics: getAdvancedMetrics(), NginxAppProtect: getNginxAppProtect(), + NAPMonitoring: getNAPMonitoring(), } for _, dir := range strings.Split(config.ConfigDirs, ":") { @@ -302,6 +312,17 @@ func getNginxAppProtect() NginxAppProtect { } } +func getNAPMonitoring() NAPMonitoring { + return NAPMonitoring{ + CollectorBufferSize: Viper.GetInt(NAPMonitoringCollectorBufferSize), + ProcessorBufferSize: Viper.GetInt(NAPMonitoringProcessorBufferSize), + SyslogIP: Viper.GetString(NAPMonitoringSyslogIP), + SyslogPort: Viper.GetInt(NAPMonitoringSyslogPort), + ReportInterval: Viper.GetDuration(NAPMonitoringReportInterval), + ReportCount: Viper.GetInt(NAPMonitoringReportCount), + } +} + func getNginx() Nginx { return Nginx{ ExcludeLogs: Viper.GetString(NginxExcludeLogs), diff --git a/src/core/config/defaults.go b/src/core/config/defaults.go index 11ec40568..2fe70c56f 100644 --- a/src/core/config/defaults.go +++ b/src/core/config/defaults.go @@ -78,6 +78,14 @@ var ( PriorityTableMaxSize: 1000, }, }, + NAPMonitoring: NAPMonitoring{ + ProcessorBufferSize: 50000, + CollectorBufferSize: 50000, + SyslogIP: "0.0.0.0", + SyslogPort: 514, + ReportInterval: time.Minute, + ReportCount: 400, + }, Features: []string{ FeatureRegistration, FeatureNginxConfig, @@ -176,6 +184,16 @@ const ( NginxAppProtectReportInterval = NginxAppProtectKey + KeyDelimiter + "report_interval" + // viper keys used in config + NAPMonitoringKey = "nap_monitoring" + + NAPMonitoringCollectorBufferSize = NAPMonitoringKey + KeyDelimiter + "collector_buffer_size" + NAPMonitoringProcessorBufferSize = NAPMonitoringKey + KeyDelimiter + "processor_buffer_size" + NAPMonitoringSyslogIP = NAPMonitoringKey + KeyDelimiter + "syslog_ip" + NAPMonitoringSyslogPort = NAPMonitoringKey + KeyDelimiter + "syslog_port" + NAPMonitoringReportInterval = NAPMonitoringKey + KeyDelimiter + "report_interval" + NAPMonitoringReportCount = NAPMonitoringKey + KeyDelimiter + "report_count" + // viper keys used in config FeaturesKey = "features" @@ -362,6 +380,23 @@ var ( Name: NginxAppProtectReportInterval, Usage: "The period of time the agent will check for App Protect software changes on the dataplane", }, + // NAP Monitoring + &IntFlag{ + Name: NAPMonitoringCollectorBufferSize, + Usage: "The buffer size used for the collection of events in the NGINX App Protect Monitoring extension.", + }, + &IntFlag{ + Name: NAPMonitoringProcessorBufferSize, + Usage: "The buffer size used by the processing of events in the NGINX App Protect Monitoring extension.", + }, + &StringFlag{ + Name: NAPMonitoringSyslogIP, + Usage: "The Syslog IP address the NGINX Agent would run on. This IP address would be used in the NGINX App Protect config to send logging events.", + }, + &IntFlag{ + Name: NAPMonitoringSyslogPort, + Usage: "The Syslog port the NGINX Agent would run on. This port would be used in the NGINX App Protect config to send logging events.", + }, // Other Config &StringFlag{ Name: DisplayNameKey, diff --git a/src/core/config/types.go b/src/core/config/types.go index 66ab795b6..a04d32037 100644 --- a/src/core/config/types.go +++ b/src/core/config/types.go @@ -26,6 +26,7 @@ type Config struct { InstanceGroup string `mapstructure:"instance_group" yaml:"instance_group,omitempty"` AdvancedMetrics AdvancedMetrics `mapstructure:"advanced_metrics" yaml:"advanced_metrics,omitempty"` NginxAppProtect NginxAppProtect `mapstructure:"nginx_app_protect" yaml:"nginx_app_protect,omitempty"` + NAPMonitoring NAPMonitoring `mapstructure:"nap_monitoring" yaml:"nap_monitoring,omitempty"` } type Server struct { @@ -89,3 +90,12 @@ type AdvancedMetrics struct { type NginxAppProtect struct { ReportInterval time.Duration `mapstructure:"report_interval" yaml:"-"` } + +type NAPMonitoring struct { + CollectorBufferSize int `mapstructure:"collector_buffer_size" yaml:"-"` + ProcessorBufferSize int `mapstructure:"processor_buffer_size" yaml:"-"` + SyslogIP string `mapstructure:"syslog_ip" yaml:"-"` + SyslogPort int `mapstructure:"syslog_port" yaml:"-"` + ReportInterval time.Duration `mapstructure:"report_interval" yaml:"-"` + ReportCount int `mapstructure:"report_count" yaml:"-"` +} diff --git a/src/extensions/advanced-metrics/pkg/schema/schema_builder.go b/src/extensions/advanced-metrics/pkg/schema/schema_builder.go index 613c6e16c..1293f2d0d 100644 --- a/src/extensions/advanced-metrics/pkg/schema/schema_builder.go +++ b/src/extensions/advanced-metrics/pkg/schema/schema_builder.go @@ -39,7 +39,8 @@ func NewSchemaBuilder() *SchemaBuilder { // NewDimension builds new dimension definition // name - name of the dimension used later by publisher to build Dimension in MetricSet // maxDimensionSetSize - cardinality of given dimension, specify maximal size of unique dimensions which will be accumulated -// during publishing period, minimum value is 4, two elements are reserved for internal use +// +// during publishing period, minimum value is 4, two elements are reserved for internal use func (b *SchemaBuilder) NewDimension(name string, maxDimensionSetSize uint32, opts ...FieldOption) *SchemaBuilder { b.fields = append(b.fields, schema.NewDimensionField(name, maxDimensionSetSize, opts...)) diff --git a/src/extensions/advanced-metrics/reader/reader.go b/src/extensions/advanced-metrics/reader/reader.go index ddd8ea40e..2b92833ef 100644 --- a/src/extensions/advanced-metrics/reader/reader.go +++ b/src/extensions/advanced-metrics/reader/reader.go @@ -43,10 +43,9 @@ type Frame interface { // // // Where: -// - is message separator character: `;` -// - is any arbitrary data forming single message with following restrictions: it could not contain and -// maximal message size is 64kB - 1(for separator) -// +// - is message separator character: `;` +// - is any arbitrary data forming single message with following restrictions: it could not contain and +// maximal message size is 64kB - 1(for separator) type Reader struct { listenerConfig ListenerConfig listener net.Listener diff --git a/src/extensions/advanced-metrics/tables/schema/field.go b/src/extensions/advanced-metrics/tables/schema/field.go index f15abf5f1..d30b631f7 100644 --- a/src/extensions/advanced-metrics/tables/schema/field.go +++ b/src/extensions/advanced-metrics/tables/schema/field.go @@ -28,7 +28,8 @@ type Field struct { // DimensionField defines dimension field specific information // KeyBitSize specifies the size of the key which will be used in the staging table to represent dimension value // MaxDimensionSetSize specifies max unique dimension which will be stored in staging table -// if max size will be reaches all new unique dimensions will be transformed to AGGR value +// +// if max size will be reaches all new unique dimensions will be transformed to AGGR value type DimensionField struct { KeyBitSize int KeyBitPositionInCompoundKey int diff --git a/src/extensions/advanced-metrics/tables/staging_table.go b/src/extensions/advanced-metrics/tables/staging_table.go index 052a220e2..4be480b4f 100644 --- a/src/extensions/advanced-metrics/tables/staging_table.go +++ b/src/extensions/advanced-metrics/tables/staging_table.go @@ -149,8 +149,9 @@ func (t *StagingTable) lookupCodeForDimension(dimension []byte, field *schema.Fi // Previous read snapshot will be cleared. // By default returned LookupSet is nil. // resetLookups determines if new instance of LookupSet should be created, old one will be returned in case of reset -// ,as Samples and LookupSet reset need to be done atomically this function -// do both functionalities instead of separate methods +// +// ,as Samples and LookupSet reset need to be done atomically this function +// do both functionalities instead of separate methods func (t *StagingTable) ReadSnapshot(resetLookups bool) (SamplesView, LookupSet) { t.Lock() defer t.Unlock() diff --git a/src/extensions/nginx-app-protect/monitoring/collector/collector.go b/src/extensions/nginx-app-protect/monitoring/collector/collector.go new file mode 100644 index 000000000..128ebdacb --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/collector/collector.go @@ -0,0 +1,15 @@ +package collector + +import ( + "context" + "sync" + + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring" +) + +// Collector is the interface implemented by collectors who wish to +// collect Raw Log data from WAF Instances. +type Collector interface { + // Collect starts collecting on collect chan until ctx.Done() chan gets a signal + Collect(ctx context.Context, wg *sync.WaitGroup, collect chan<- *monitoring.RawLog) +} diff --git a/src/extensions/nginx-app-protect/monitoring/collector/config.go b/src/extensions/nginx-app-protect/monitoring/collector/config.go new file mode 100644 index 000000000..6c0ecea5b --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/collector/config.go @@ -0,0 +1,12 @@ +package collector + +import ( + "github.com/sirupsen/logrus" +) + +// NAPConfig holds the config for NAPConfig Collector. +type NAPConfig struct { + SyslogIP string + SyslogPort int + Logger *logrus.Entry +} diff --git a/src/extensions/nginx-app-protect/monitoring/collector/nap.go b/src/extensions/nginx-app-protect/monitoring/collector/nap.go new file mode 100644 index 000000000..c11a2e3ab --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/collector/nap.go @@ -0,0 +1,109 @@ +package collector + +import ( + "context" + "fmt" + "sync" + + "github.com/sirupsen/logrus" + "gopkg.in/mcuadros/go-syslog.v2" + + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring" +) + +const ( + napComponentName = "collector:nap" +) + +var ( + // logging fields for the component + componentLogFields = logrus.Fields{ + "component": napComponentName, + } +) + +// NAPCollector lets you to Collect log data on given port. +type NAPCollector struct { + syslog *syslogServer + logger *logrus.Entry +} + +type syslogServer struct { + channel syslog.LogPartsChannel + handler *syslog.ChannelHandler + server *syslog.Server +} + +// NewNAPCollector gives you a NAP collector for the syslog server. +func NewNAPCollector(cfg *NAPConfig) (napCollector *NAPCollector, err error) { + napCollector = &NAPCollector{} + + napCollector.logger = logrus.StandardLogger().WithFields(componentLogFields) + if cfg.Logger != nil { + napCollector.logger = cfg.Logger.WithFields(componentLogFields) + } + napCollector.logger.Infof("Getting %s Collector", monitoring.NAP) + + napCollector.syslog, err = newSyslogServer(napCollector.logger, cfg.SyslogIP, cfg.SyslogPort) + if err != nil { + return nil, err + } + + return napCollector, nil +} + +func newSyslogServer(logger *logrus.Entry, ip string, port int) (*syslogServer, error) { + channel := make(syslog.LogPartsChannel) + handler := syslog.NewChannelHandler(channel) + + server := syslog.NewServer() + server.SetFormat(syslog.RFC3164) + server.SetHandler(handler) + + addr := fmt.Sprintf("%s:%d", ip, port) + err := server.ListenTCP(addr) + if err != nil { + msg := fmt.Sprintf("Error while configuring syslog server to listen on %s:\n %v", addr, err) + logger.Error(msg) + return nil, err + } + + err = server.Boot() + if err != nil { + msg := fmt.Sprintf("Error while booting the syslog server at %s:\n %v ", addr, err) + logger.Error(msg) + return nil, err + } + + return &syslogServer{channel, handler, server}, nil +} + +// Collect starts collecting on collect chan until done chan gets a signal. +func (nap *NAPCollector) Collect(ctx context.Context, wg *sync.WaitGroup, collect chan<- *monitoring.RawLog) { + defer wg.Done() + + nap.logger.Infof("Starting collection for %s", monitoring.NAP) + + for { + select { + case logParts := <-nap.syslog.channel: + line, ok := logParts["content"].(string) + if !ok { + nap.logger.Warnf("Noncompliant syslog message, got: %v", logParts) + break + } + + nap.logger.Infof("collected log line succesfully.") + collect <- &monitoring.RawLog{Origin: monitoring.NAP, Logline: line} + case <-ctx.Done(): + nap.logger.Infof("Context cancellation, collector is wrapping up...") + + err := nap.syslog.server.Kill() + if err != nil { + nap.logger.Errorf("Error while killing syslog collector server: %v", err) + } + + return + } + } +} diff --git a/src/extensions/nginx-app-protect/monitoring/collector/nap_test.go b/src/extensions/nginx-app-protect/monitoring/collector/nap_test.go new file mode 100644 index 000000000..56b1a40ae --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/collector/nap_test.go @@ -0,0 +1,70 @@ +package collector_test + +import ( + "context" + "fmt" + "log/syslog" + "strconv" + "strings" + "sync" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gopkg.in/mcuadros/go-syslog.v2/format" + + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring" + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/collector" +) + +func TestNAPCollect(t *testing.T) { + var logwriter *syslog.Writer + var testPort = 22514 + var testIP = "127.0.0.1" + + waf, err := collector.NewNAPCollector(&collector.NAPConfig{ + SyslogIP: testIP, + SyslogPort: testPort, + }) + require.NoError(t, err, "Error while setting up syslog: %v", err) + + collect := make(chan *monitoring.RawLog, 2) + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + wg := &sync.WaitGroup{} + wg.Add(1) + + go waf.Collect(ctx, wg, collect) + + logwriter, err = syslog.Dial("tcp4", testIP+":"+strconv.Itoa(testPort), syslog.LOG_INFO|syslog.LOG_USER, "test") + if err != nil { + t.Errorf("Error while dialing into syslog: %v", err) + } + + msg := "Hello Logs!" + + err = logwriter.Info(msg) + if err != nil { + t.Errorf("Error while writing to syslog: %v", err) + } + + readline := <-collect + assert.True(t, strings.Contains(readline.Logline, msg), fmt.Sprintf("Wrote `%s`, got `%s` \n", msg, readline.Logline)) +} + +func TestNAPSyslogParser(t *testing.T) { + find := `<131>Oct 7 18:19:38 9a44c32084d2 ASM:unit_hostname="itay-108-117.f5net.com""` + expected := `unit_hostname="itay-108-117.f5net.com""` + + f := format.RFC3164{} + parser := f.GetParser([]byte(find)) + err := parser.Parse() + + if err != nil { + t.Errorf("Error while parsing syslog: %v", err) + } + + assert.Equal(t, expected, parser.Dump()["content"], "Could not parse syslog message") +} diff --git a/src/extensions/nginx-app-protect/monitoring/manager/manager.go b/src/extensions/nginx-app-protect/monitoring/manager/manager.go new file mode 100644 index 000000000..8d5f45b54 --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/manager/manager.go @@ -0,0 +1,158 @@ +package manager + +import ( + "context" + "runtime" + "sync" + + log "github.com/sirupsen/logrus" + + models "github.com/nginx/agent/sdk/v2/proto/events" + "github.com/nginx/agent/v2/src/core/config" + "github.com/nginx/agent/v2/src/core/metrics" + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring" + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/collector" + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring/processor" +) + +const ( + componentName = "security-events-manager" + defaultCollectorBufferSize = 50000 + defaultProcessorBufferSize = 50000 +) + +type Manager struct { + config *config.Config + syslogIP string + syslogPort int + logger *log.Entry + + collector collector.Collector + collectChan chan *monitoring.RawLog + + processor *processor.Client + processorChan chan *models.Event +} + +func NewManager(config *config.Config, commonDims *metrics.CommonDim) (*Manager, error) { + m := &Manager{ + config: config, + syslogIP: config.NAPMonitoring.SyslogIP, + syslogPort: config.NAPMonitoring.SyslogPort, + } + + err := m.init(commonDims) + if err != nil { + return nil, err + } + + return m, nil +} + +func (s *Manager) Name() string { + return componentName +} + +func (s *Manager) init(commonDims *metrics.CommonDim) error { + var err error + + s.initLogging() + s.logger.Infof("Initializing %s", componentName) + + err = s.initCollector() + if err != nil { + s.logger.Errorf("Could not initialize %s collector: %s", componentName, err) + return err + } + + err = s.initProcessor(commonDims) + if err != nil { + s.logger.Errorf("Could not initialize %s processor: %s", componentName, err) + return err + } + + return nil +} + +func (s *Manager) initLogging() { + s.logger = log.WithFields(log.Fields{ + "extension": componentName, + }) +} + +func (s *Manager) initCollector() error { + var err error + + s.logger.Infof("Initializing %s collector", componentName) + + s.collector, err = collector.NewNAPCollector(&collector.NAPConfig{ + SyslogIP: s.syslogIP, + SyslogPort: s.syslogPort, + Logger: s.logger, + }) + + if err != nil { + s.logger.Errorf("Could not setup a %s collector. Got %v.", monitoring.NAP, err) + return err + } + + if s.config.NAPMonitoring.CollectorBufferSize > 0 { + s.collectChan = make(chan *monitoring.RawLog, s.config.NAPMonitoring.CollectorBufferSize) + } else { + s.logger.Warnf("CollectorBufferSize cannot be zero or negative. Defaulting to %v", defaultCollectorBufferSize) + s.collectChan = make(chan *monitoring.RawLog, defaultCollectorBufferSize) + } + + return nil +} + +func (s *Manager) initProcessor(commonDims *metrics.CommonDim) error { + var err error + + s.logger.Infof("Initializing %s processor", componentName) + + s.processor, err = processor.GetClient(&processor.Config{ + Logger: s.logger, + Workers: runtime.NumCPU(), + CommonDims: commonDims, + }) + + if err != nil { + s.logger.Errorf("Could not get a Processor Client: %s", err) + return err + } + + if s.config.NAPMonitoring.ProcessorBufferSize > 0 { + s.processorChan = make(chan *models.Event, s.config.NAPMonitoring.ProcessorBufferSize) + } else { + s.logger.Warnf("ProcessorBufferSize cannot be zero or negative. Defaulting to %v", defaultProcessorBufferSize) + s.processorChan = make(chan *models.Event, defaultProcessorBufferSize) + } + + return nil +} + +func (s *Manager) Run(ctx context.Context) { + s.logger.Infof("Starting to run %s", componentName) + + chtx, cancel := context.WithCancel(ctx) + defer cancel() + + waitGroup := &sync.WaitGroup{} + waitGroup.Add(2) + + go s.collector.Collect(chtx, waitGroup, s.collectChan) + go s.processor.Process(chtx, waitGroup, s.collectChan, s.processorChan) + + <-ctx.Done() + s.logger.Infof("Received Context cancellation, %s is wrapping up...", componentName) + + waitGroup.Wait() + + s.logger.Infof("Context cancellation, %s wrapped up...", componentName) +} + +// OutChannel returns processorChan channel which will publish events +func (m *Manager) OutChannel() chan *models.Event { + return m.processorChan +} diff --git a/src/extensions/nginx-app-protect/monitoring/manager/manager_test.go b/src/extensions/nginx-app-protect/monitoring/manager/manager_test.go new file mode 100644 index 000000000..016adc3ce --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/manager/manager_test.go @@ -0,0 +1,39 @@ +package manager + +import ( + "context" + "github.com/nginx/agent/v2/src/core/metrics" + "testing" + "time" + + "github.com/nginx/agent/v2/src/core/config" + "github.com/stretchr/testify/assert" +) + +func TestManager_Close(t *testing.T) { + conf := &config.Config{ + Log: config.LogConfig{ + Level: "debug", + }, + NAPMonitoring: config.NAPMonitoring{ + CollectorBufferSize: 1, + ProcessorBufferSize: 1, + SyslogIP: "127.0.0.1", + SyslogPort: 1234, + }, + } + + m, err := NewManager(conf, &metrics.CommonDim{}) + assert.NoError(t, err) + + ctx, cancel := context.WithCancel(context.Background()) + + go func(ctx context.Context) { + time.Sleep(1 * time.Second) + cancel() + }(ctx) + + m.Run(ctx) + + assert.Equal(t, context.Canceled, ctx.Err()) +} diff --git a/src/extensions/nginx-app-protect/monitoring/processor/config.go b/src/extensions/nginx-app-protect/monitoring/processor/config.go new file mode 100644 index 000000000..d852d909e --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/processor/config.go @@ -0,0 +1,14 @@ +package processor + +import ( + "github.com/sirupsen/logrus" + + "github.com/nginx/agent/v2/src/core/metrics" +) + +// Config holds the config for Processor. +type Config struct { + Logger *logrus.Entry + Workers int + CommonDims *metrics.CommonDim +} diff --git a/src/extensions/nginx-app-protect/monitoring/processor/metadata.go b/src/extensions/nginx-app-protect/monitoring/processor/metadata.go new file mode 100644 index 000000000..c65a4d7fc --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/processor/metadata.go @@ -0,0 +1,33 @@ +package processor + +import ( + "github.com/gogo/protobuf/types" + "github.com/google/uuid" + + pb "github.com/nginx/agent/sdk/v2/proto/events" +) + +// NewMetadata provides the event metadata for a given timestamp and correlationID. +func NewMetadata(timestamp *types.Timestamp, correlationID string) (*pb.Metadata, error) { + var ( + metadata pb.Metadata + err error + ) + + id, err := uuid.NewUUID() + if err != nil { + return nil, err + } + + metadata.Module = "Agent" + metadata.UUID = id.String() + metadata.CorrelationID = correlationID + metadata.Timestamp = timestamp + + metadata.Type = "Nginx" + metadata.Category = "AppProtect" + + metadata.EventLevel = "ERROR" + + return &metadata, err +} diff --git a/src/extensions/nginx-app-protect/monitoring/processor/nap.go b/src/extensions/nginx-app-protect/monitoring/processor/nap.go new file mode 100644 index 000000000..b64287f40 --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/processor/nap.go @@ -0,0 +1,591 @@ +package processor + +import ( + "encoding/base64" + "encoding/xml" + "errors" + "fmt" + "regexp" + "strings" + "time" + + "github.com/gogo/protobuf/types" + "github.com/sirupsen/logrus" + + models "github.com/nginx/agent/sdk/v2/proto/events" +) + +const ( + napDateTimeLayout = "2006-01-02 15:04:05.000" + listSeperator = "::" + parameterCtx = "parameter" + headerCtx = "header" + cookieCtx = "cookie" +) + +var ( + logFormatKeys = []string{ + // TODO: Remove `date_time` from syslog format as it is unused (NMS-38119) + "date_time", + "blocking_exception_reason", + "dest_port", + "ip_client", + "is_truncated", + "method", + "policy_name", + "protocol", + "request_status", + "response_code", + "severity", + "sig_cves", + "sig_ids", + "sig_names", + "sig_set_names", + "src_port", + "sub_violations", + "support_id", + "threat_campaign_names", + "unit_hostname", + "uri", + "violation_rating", + "vs_name", + "x_forwarded_for_header_value", + "outcome", + "outcome_reason", + "violations", + "violation_details", + "bot_signature_name", + "bot_category", + "bot_anomalies", + "enforced_bot_anomalies", + "client_class", + "client_application", + "client_application_version", + "transport_protocol", + } +) + +const ( + // TODO: Identify the usage of the following new keys (NMS-38311) + blockingExceptionReason = "blocking_exception_reason" + protocol = "protocol" + requestStatus = "request_status" + severity = "severity" + sigSetNames = "sig_set_names" + threatCampaignNames = "threat_campaign_names" + unitHostname = "unit_hostname" + violationDetails = "violation_details" + clientApplication = "client_application" + clientApplicationVersion = "client_application_version" + transportProtocol = "transport_protocol" + // Older CAS Naming (this needs to be removed) + // httpRequestMethod = "http_request_method" + // httpResponseCode = "http_response_code" + // sigCVEs = "signature_cves" + // sigIds = "signature_ids" + // sigNames = "signature_names" + // httpRemotePort = "http_remote_port" + // httpURI = "http_uri" + // httpHostname = "http_hostname" + // requestOutcome = "request_outcome" + // requestOutcomeReason = "request_outcome_reason" + // description = "description" + // As -> description == "attack_type" + // httpRemoteAddr = "http_remote_addr" + // httpServerPort = "http_server_port" + // isTruncated = "is_truncated_bool" + + // Using default values instead of overriden keys per older CAS policy + httpRequestMethod = "method" + httpResponseCode = "response_code" + sigCVEs = "sig_cves" + sigIds = "sig_ids" + sigNames = "sig_names" + httpRemotePort = "src_port" + httpURI = "uri" + httpHostname = "vs_name" + requestOutcome = "outcome" + requestOutcomeReason = "outcome_reason" + httpRemoteAddr = "ip_client" + httpServerPort = "dest_port" + isTruncated = "is_truncated" + + // Existing parsed keys from the log + dateTime = "date_time" + policyName = "policy_name" + request = "request" + subViolations = "sub_violations" + supportID = "support_id" + violations = "violations" + violationRating = "violation_rating" + xForwardedForHeaderVal = "x_forwarded_for_header_value" + botAnomalies = "bot_anomalies" + botCategory = "bot_category" + clientClass = "client_class" + botSignatureName = "bot_signature_name" + enforcedBotAnomalies = "enforced_bot_anomalies" +) + +type ParameterData struct { + Text string `xml:",chardata"` + Name string `xml:"name"` + Value string `xml:"value"` +} + +type ParamData struct { + Text string `xml:",chardata"` + Name string `xml:"param_name"` + Value string `xml:"param_value"` +} + +type Header struct { + Text string `xml:",chardata"` + Name string `xml:"header_name"` + Value string `xml:"header_value"` +} + +type Cookie struct { + Text string `xml:",chardata"` + Name string `xml:"cookie_name"` + Value string `xml:"cookie_value"` +} + +type BADMSG struct { + XMLName xml.Name `xml:"BAD_MSG"` + Text string `xml:",chardata"` + ViolationMasks struct { + Text string `xml:",chardata"` + Block string `xml:"block"` + Alarm string `xml:"alarm"` + Learn string `xml:"learn"` + Staging string `xml:"staging"` + } `xml:"violation_masks"` + RequestViolations struct { + Text string `xml:",chardata"` + Violation []struct { + Text string `xml:",chardata"` + ViolIndex string `xml:"viol_index"` + ViolName string `xml:"viol_name"` + Context string `xml:"context"` + // ParameterData and ParamData are both received when context == "parameter" | "" + // We receive either ParameterData or ParamData separately and not in the same XML message + // ParameterData and ParamData semantically represent the same thing (with ParameterData having more fields). + ParameterData ParameterData `xml:"parameter_data"` + ParamData ParamData `xml:"param_data"` + Header Header `xml:"header"` + Cookie Cookie `xml:"cookie"` + Staging string `xml:"staging"` + SigData []struct { + Text string `xml:",chardata"` + SigID string `xml:"sig_id"` + BlockingMask string `xml:"blocking_mask"` + KwData struct { + Text string `xml:",chardata"` + Buffer string `xml:"buffer"` + Offset string `xml:"offset"` + Length string `xml:"length"` + } `xml:"kw_data"` + } `xml:"sig_data"` + HTTPSanityChecksStatus string `xml:"http_sanity_checks_status"` + HTTPSubViolationStatus string `xml:"http_sub_violation_status"` + HTTPSubViolation string `xml:"http_sub_violation"` + WildcardEntity string `xml:"wildcard_entity"` + LanguageType string `xml:"language_type"` + MetacharIndex []string `xml:"metachar_index"` + } `xml:"violation"` + } `xml:"request-violations"` +} + +type NAPConfig struct { + DateTime string + BlockingExceptionReason string + HTTPServerPort string + HTTPRemoteAddr string + IsTruncated string + HTTPRequestMethod string + PolicyName string + Protocol string + RequestStatus string + HTTPResponseCode string + Severity string + SignatureCVEs string + SignatureIDs string + SignatureNames string + SigSetNames string + HTTPRemotePort string + SubViolations string + SupportID string + ThreatCampaignNames string + UnitHostname string + HTTPURI string + ViolationRating string + HTTPHostname string + XForwardedForHeaderVal string + RequestOutcome string + RequestOutcomeReason string + Violations string + ViolationDetailsXML *BADMSG + BotSignatureName string + BotCategory string + BotAnomalies string + EnforcedBotAnomalies string + ClientClass string + ClientApplication string + ClientApplicationVersion string + Request string + TransportProtocol string + ViolationContext string +} + +// GetEvent will generate a protobuf Security Event. +func (f *NAPConfig) GetEvent(hostPattern *regexp.Regexp, logger *logrus.Entry) (*models.Event, error) { + var ( + event models.Event + secevt *models.SecurityViolationEvent + err error + ) + + if logger == nil { + logger = logrus.StandardLogger().WithFields(componentLogFields) + } + + metadata, err := f.getMetadata() + if err != nil { + return nil, err + } + event.Metadata = metadata + + secevt = f.getSecurityViolation(logger) + if err != nil { + return nil, err + } + event.Data = &models.Event_SecurityViolationEvent{ + SecurityViolationEvent: secevt, + } + + return &event, err +} + +func (f *NAPConfig) getSecurityViolation(logger *logrus.Entry) *models.SecurityViolationEvent { + return &models.SecurityViolationEvent{ + PolicyName: f.PolicyName, + SupportID: f.SupportID, + BlockingExceptionReason: f.BlockingExceptionReason, + Method: f.HTTPRequestMethod, + Protocol: f.Protocol, + XForwardedForHeaderValue: f.XForwardedForHeaderVal, + Request: f.Request, + IsTruncated: f.IsTruncated, + RequestStatus: f.RequestStatus, + ResponseCode: f.HTTPResponseCode, + UnitHostname: f.UnitHostname, + VSName: f.HTTPHostname, + IPClient: f.HTTPRemoteAddr, + DestinationPort: f.HTTPRemotePort, + SourcePort: f.HTTPServerPort, + Violations: f.Violations, + SubViolations: f.SubViolations, + ViolationRating: f.ViolationRating, + SigID: f.SignatureIDs, + SigNames: f.SignatureNames, + SigSetNames: f.SigSetNames, + SigCVEs: f.SignatureCVEs, + Severity: f.Severity, + ThreatCampaignNames: f.ThreatCampaignNames, + ClientClass: f.ClientClass, + ClientApplication: f.ClientApplication, + ClientApplicationVersion: f.ClientApplicationVersion, + BotAnomalies: f.BotAnomalies, + BotCategory: f.BotCategory, + BotSignatureName: f.BotSignatureName, + EnforcedBotAnomalies: f.EnforcedBotAnomalies, + ViolationContexts: f.getViolationContext(), + ViolationsData: f.getViolations(logger), + // TODO: The following items needs to be fixed before release (NMS-38119) + DateTime: f.DateTime, // remove, metadata has it + Outcome: f.RequestOutcome, //rename the proto + OutcomeReason: f.RequestOutcomeReason, //rename the proto + URI: f.HTTPURI, // rename to HTTP URI? + GeoIP: "blah", // to add + Host: "blah", // to add + SourceHost: "blah", // remove, this is the same as HTTPRemoteAddr + SeverityLabel: "blah", // to do + Priority: "blah", // to do + } +} + +func (f *NAPConfig) getMetadata() (*models.Metadata, error) { + f.DateTime = time.Now().UTC().Format(napDateTimeLayout) + + t, err := parseNAPDateTime(f.DateTime) + if err != nil { + return nil, err + } + + return NewMetadata(t, f.SupportID) +} + +func (f *NAPConfig) getViolationContext() string { + contexts := []string{} + if f.ViolationDetailsXML != nil { + for _, v := range f.ViolationDetailsXML.RequestViolations.Violation { + if v.Context != "" { + contexts = append(contexts, v.Context) + } + } + } + return strings.Join(contexts, ",") +} + +func (f *NAPConfig) getViolations(logger *logrus.Entry) []*models.ViolationData { + violations := []*models.ViolationData{} + + if f.ViolationDetailsXML == nil { + return violations + } + + for _, v := range f.ViolationDetailsXML.RequestViolations.Violation { + violation := models.ViolationData{ + Name: v.ViolName, + Context: v.Context, + } + + switch v.Context { + case parameterCtx, "": + if v.ParameterData != (ParameterData{}) { + decodedName, err := base64.StdEncoding.DecodeString(v.ParameterData.Name) + if err != nil { + logger.Errorf("could not decode the Paramater Name %s for %v", v.ParameterData.Name, f.SupportID) + break + } + + decodedValue, err := base64.StdEncoding.DecodeString(v.ParameterData.Value) + if err != nil { + logger.Errorf("could not decode the Paramater Value %s for %v", v.ParameterData.Value, f.SupportID) + break + } + + violation.ContextData = &models.ContextData{ + Name: string(decodedName), + Value: string(decodedValue), + } + } else if v.ParamData != (ParamData{}) { + decodedName, err := base64.StdEncoding.DecodeString(v.ParamData.Name) + if err != nil { + logger.Errorf("could not decode the Paramater Name %s for %v", v.ParamData.Name, f.SupportID) + break + } + + decodedValue, err := base64.StdEncoding.DecodeString(v.ParamData.Value) + if err != nil { + logger.Errorf("could not decode the Paramater Value %s for %v", v.ParamData.Value, f.SupportID) + break + } + + violation.ContextData = &models.ContextData{ + Name: string(decodedName), + Value: string(decodedValue), + } + } else if v.Context == parameterCtx { + logger.Warn("context is parameter but no Parameter data received") + } + case headerCtx: + if v.Header == (Header{}) { + logger.Warn("context is header but no Header data received") + break + } + + decodedName, err := base64.StdEncoding.DecodeString(v.Header.Name) + if err != nil { + logger.Errorf("could not decode the Header Name %s for %v", v.Header.Name, f.SupportID) + break + } + + decodedValue, err := base64.StdEncoding.DecodeString(v.Header.Value) + if err != nil { + logger.Errorf("could not decode the Header Value %s for %v", v.Header.Value, f.SupportID) + break + } + + violation.ContextData = &models.ContextData{ + Name: string(decodedName), + Value: string(decodedValue), + } + case cookieCtx: + if v.Cookie == (Cookie{}) { + logger.Warn("context is cookie but no Cookie data received") + break + } + + decodedName, err := base64.StdEncoding.DecodeString(v.Cookie.Name) + if err != nil { + logger.Errorf("could not decode the Cookie Name %s for %v", v.Cookie.Name, f.SupportID) + break + } + + decodedValue, err := base64.StdEncoding.DecodeString(v.Cookie.Value) + if err != nil { + logger.Errorf("could not decode the Cookie Value %s for %v", v.Cookie.Value, f.SupportID) + break + } + + violation.ContextData = &models.ContextData{ + Name: string(decodedName), + Value: string(decodedValue), + } + default: + logger.Warnf("Got an invalid context %v while parsing ViolationDetails for %v", v.Context, f.SupportID) + } + + for _, s := range v.SigData { + buf, err := base64.StdEncoding.DecodeString(s.KwData.Buffer) + if err != nil { + logger.Errorf("could not decode the Buffer value %s for %v", s, f.SupportID) + continue + } + + violation.Signatures = append(violation.Signatures, &models.SignatureData{ + ID: s.SigID, + BlockingMask: s.BlockingMask, + Buffer: string(buf), + Offset: s.KwData.Offset, + Length: s.KwData.Length, + }) + } + + violations = append(violations, &violation) + } + + return violations +} + +// Parse the NAP date time string into a Proto Time type. +func parseNAPDateTime(raw string) (*types.Timestamp, error) { + t, err := time.Parse(napDateTimeLayout, raw) + if err != nil { + return nil, err + } + + return types.TimestampProto(t) +} + +// TODO: Assumptions while parsing the NAP Syslog data (NMS-38118) +// 1. list values do not contain `commas`, rather have `::` as delimiter +// 2. no json values +// 3. no other comma exists in the response other than the delimiter comma +func parseNAP(logEntry string, logger *logrus.Entry) (*NAPConfig, error) { + var waf NAPConfig + + logger.Debugf("Got log entry: %s", logEntry) + + values := strings.Split(logEntry, ",") + + for idx, key := range logFormatKeys { + err := setValue(&waf, key, values[idx], logger) + if err != nil { + return &NAPConfig{}, err + } + } + + err := setValue(&waf, "request", strings.Join(values[len(logFormatKeys):], ","), logger) + if err != nil { + return &NAPConfig{}, err + } + + return &waf, nil +} + +func setValue(napConfig *NAPConfig, key, value string, logger *logrus.Entry) error { + switch key { + case blockingExceptionReason: + napConfig.BlockingExceptionReason = value + case protocol: + napConfig.Protocol = value + case requestStatus: + napConfig.RequestStatus = value + case severity: + napConfig.Severity = value + case sigSetNames: + napConfig.SigSetNames = replaceEncodedList(value, listSeperator) + case threatCampaignNames: + napConfig.ThreatCampaignNames = value + case unitHostname: + napConfig.UnitHostname = value + case violationDetails: + napConfig.ViolationDetailsXML = func(data string) *BADMSG { + var xmlData BADMSG + err := xml.Unmarshal([]byte(data), &xmlData) + if err != nil { + logger.Errorf("failed to parse XML message: %v", err) + return nil + } + return &xmlData + }(value) + case clientApplication: + napConfig.ClientApplication = value + case clientApplicationVersion: + napConfig.ClientApplicationVersion = value + case transportProtocol: + napConfig.TransportProtocol = value + case dateTime: + napConfig.DateTime = value + case httpHostname: + napConfig.HTTPHostname = value + case httpRemoteAddr: + napConfig.HTTPRemoteAddr = value + case httpRemotePort: + napConfig.HTTPRemotePort = value + case httpRequestMethod: + napConfig.HTTPRequestMethod = value + case httpResponseCode: + napConfig.HTTPResponseCode = value + case httpServerPort: + napConfig.HTTPServerPort = value + case httpURI: + napConfig.HTTPURI = value + case isTruncated: + napConfig.IsTruncated = value + case policyName: + napConfig.PolicyName = value + case request: + napConfig.Request = value + case requestOutcome: + napConfig.RequestOutcome = value + case requestOutcomeReason: + napConfig.RequestOutcomeReason = value + case sigCVEs: + napConfig.SignatureCVEs = replaceEncodedList(value, listSeperator) + case sigIds: + napConfig.SignatureIDs = replaceEncodedList(value, listSeperator) + case sigNames: + napConfig.SignatureNames = replaceEncodedList(value, listSeperator) + case subViolations: + napConfig.SubViolations = value + case supportID: + napConfig.SupportID = value + case violations: + napConfig.Violations = replaceEncodedList(value, listSeperator) + case violationRating: + napConfig.ViolationRating = value + case xForwardedForHeaderVal: + napConfig.XForwardedForHeaderVal = value + case botAnomalies: + napConfig.BotAnomalies = value + case botCategory: + napConfig.BotCategory = value + case clientClass: + napConfig.ClientClass = value + case botSignatureName: + napConfig.BotSignatureName = value + case enforcedBotAnomalies: + napConfig.EnforcedBotAnomalies = value + default: + msg := fmt.Sprintf("Invalid field for NAP Config - %s", key) + return errors.New(msg) + } + return nil +} + +func replaceEncodedList(entry, decoder string) string { + return strings.ReplaceAll(entry, decoder, ",") +} diff --git a/src/extensions/nginx-app-protect/monitoring/processor/nap_test.go b/src/extensions/nginx-app-protect/monitoring/processor/nap_test.go new file mode 100644 index 000000000..8ff506146 --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/processor/nap_test.go @@ -0,0 +1,41 @@ +package processor + +import ( + "fmt" + "os" + "testing" + + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" +) + +func TestParseNAPExpanded(t *testing.T) { + testCases := []struct { + testName string + logEntry string + expNAPConfig *NAPConfig + expError error + }{ + { + testName: "ValidEntry", + logEntry: fmt.Sprintf(`"%s"`, func() string { + input, _ := os.ReadFile("./testdata/expanded_nap_waf.log.txt") + return string(input) + }()), + expNAPConfig: &NAPConfig{}, + expError: nil, + }, + } + + log := logrus.New() + log.SetLevel(logrus.DebugLevel) + + for _, tc := range testCases { + t.Run(tc.testName, func(t *testing.T) { + _, err := parseNAP(tc.logEntry, log.WithFields(logrus.Fields{ + "extension": "test", + })) + assert.Equal(t, tc.expError, err) + }) + } +} diff --git a/src/extensions/nginx-app-protect/monitoring/processor/processor.go b/src/extensions/nginx-app-protect/monitoring/processor/processor.go new file mode 100644 index 000000000..6c96a042c --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/processor/processor.go @@ -0,0 +1,145 @@ +package processor + +import ( + "context" + "errors" + "fmt" + "regexp" + "sync" + + "github.com/sirupsen/logrus" + + pb "github.com/nginx/agent/sdk/v2/proto/events" + "github.com/nginx/agent/v2/src/core/metrics" + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring" +) + +const ( + componentName = "processor" + hostnameFormat = `(?m)\d+\-(.*)\:\d+\-.*` +) + +var ( + // logging fields for the component + componentLogFields = logrus.Fields{ + "component": componentName, + } + errFalsePositive = errors.New("false positive event detected, will not generate event") +) + +// Eventer is the interface implemented to generate an Event from a log entry. +type Eventer interface { + // GetEvent will generate a protobuf Security Event + GetEvent(hostPattern *regexp.Regexp, logger *logrus.Entry) (*pb.Event, error) +} + +// Client for Processor with capability of logging. +type Client struct { + logger *logrus.Entry + workers int + hostPattern *regexp.Regexp + commonDims *metrics.CommonDim +} + +// GetClient gives you a Client for processing. +func GetClient(cfg *Config) (*Client, error) { + var c Client + + c.logger = logrus.StandardLogger().WithFields(componentLogFields) + if cfg.Logger != nil { + c.logger = cfg.Logger.WithFields(componentLogFields) + } + + c.workers = 1 + if cfg.Workers > 1 { + c.workers = cfg.Workers + } + + hostPattern, err := regexp.Compile(hostnameFormat) + if err != nil { + c.logger.Errorf("could not compile the hostname regex: %v", err) + return &c, err + } + c.hostPattern = hostPattern + + if cfg.CommonDims == nil { + c.logger.Warnf("common dimensions are not passed to NAP Monitoring processor") + cfg.CommonDims = &metrics.CommonDim{} + } + c.commonDims = cfg.CommonDims + + return &c, nil +} + +// processorWorker is a worker process to process events. +func (c *Client) processorWorker(ctx context.Context, wg *sync.WaitGroup, id int, collected <-chan *monitoring.RawLog, processed chan<- *pb.Event) { + defer wg.Done() + + c.logger.Debugf("Setting up Processor Worker: %d", id) + + for { + select { + case logline := <-collected: + e, err := c.parse(logline.Origin, logline.Logline) + if err != nil { + c.logger.Errorf("%d: Error while parsing %s's log: %s, Error: %v", id, logline.Origin, logline.Logline, err) + break + } + + var event *pb.Event + event, err = e.GetEvent(c.hostPattern, c.logger) + if err != nil { + if errors.Is(err, errFalsePositive) { + c.logger.Debugf("%d: Event %s generated: %s", id, logline.Logline, err) + } else { + c.logger.Errorf("%d: Error while generating event %s: %s", id, logline.Logline, err) + } + break + } + + if event.GetSecurityViolationEvent() == nil { + c.logger.Errorf("event expected as SecurityViolationEvent from nap monitor processing") + break + } + + event.GetSecurityViolationEvent().SystemID = c.commonDims.SystemId + event.GetSecurityViolationEvent().Hostname = c.commonDims.Hostname + event.GetSecurityViolationEvent().InstanceTags = c.commonDims.InstanceTags + event.GetSecurityViolationEvent().InstanceGroup = c.commonDims.InstanceGroup + event.GetSecurityViolationEvent().DisplayName = c.commonDims.DisplayName + event.GetSecurityViolationEvent().NginxID = c.commonDims.NginxId + + c.logger.Debugf("%d: Generated Event: %s", id, event) + processed <- event + + case <-ctx.Done(): + c.logger.Debugf("%d: Context cancellation, processor is wrapping up...", id) + return + } + } +} + +// Process processes the raw log entries from collected chan into Security Events on processed chan. +func (c *Client) Process(ctx context.Context, wg *sync.WaitGroup, collected <-chan *monitoring.RawLog, processed chan<- *pb.Event) { + defer wg.Done() + + c.logger.Info("Setting up Processor") + + for id := 1; id <= c.workers; id++ { + wg.Add(1) + go c.processorWorker(ctx, wg, id, collected, processed) + } + + c.logger.Infof("Done setting up %v Processor Workers", c.workers) +} + +func (c *Client) parse(waf monitoring.WAFType, logentry string) (Eventer, error) { + switch waf { + case monitoring.NAP: + return parseNAP(logentry, c.logger) + default: + err := fmt.Errorf("could not parse logentry, invalid WAF type: %s", waf) + c.logger.Error(err) + return nil, err + } +} diff --git a/src/extensions/nginx-app-protect/monitoring/processor/processor_test.go b/src/extensions/nginx-app-protect/monitoring/processor/processor_test.go new file mode 100644 index 000000000..aa9a372fa --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/processor/processor_test.go @@ -0,0 +1,132 @@ +package processor + +import ( + "context" + "os" + "sync" + "testing" + "time" + + "github.com/sirupsen/logrus" + + pb "github.com/nginx/agent/sdk/v2/proto/events" + "github.com/nginx/agent/v2/src/extensions/nginx-app-protect/monitoring" +) + +const ( + // in seconds + eventWaitTimeout = 5 + numWorkers = 4 +) + +func TestNAPProcess(t *testing.T) { + testCases := []struct { + testName string + testFile string + expected *pb.Event + isNegative bool + fileExists bool + }{ + { + testName: "PassedEvent", + testFile: "./testdata/expanded_nap_waf.log.txt", + expected: nil, + // Event will not be generated because violationRating = 0, so it will be ignored as a low-risk event. + isNegative: false, + }, + + // XML Parsing + { + testName: "violation name parsing", + testFile: "./testdata/xml_violation_name.log.txt", + expected: nil, + // Event will not be generated because violationRating = 0, so it will be ignored as a low-risk event. + isNegative: false, + }, + { + testName: "parameter data parsing", + testFile: "./testdata/xml_parameter_data.log.txt", + expected: nil, + // Event will not be generated because violationRating = 0, so it will be ignored as a low-risk event. + isNegative: false, + }, + { + testName: "parameter data parsing with empty context key", + testFile: "./testdata/xml_parameter_data_empty_context.log.txt", + expected: nil, + // Event will not be generated because violationRating = 0, so it will be ignored as a low-risk event. + isNegative: false, + }, + { + testName: "parameter data parsing as param_data", + testFile: "./testdata/xml_parameter_data_as_param_data.log.txt", + expected: nil, + // Event will not be generated because violationRating = 0, so it will be ignored as a low-risk event. + isNegative: false, + }, + { + testName: "header data parsing", + testFile: "./testdata/xml_header_data.log.txt", + expected: nil, + // Event will not be generated because violationRating = 0, so it will be ignored as a low-risk event. + isNegative: false, + }, + { + testName: "signature data parsing", + testFile: "./testdata/xml_signature_data.log.txt", + expected: nil, + // Event will not be generated because violationRating = 0, so it will be ignored as a low-risk event. + isNegative: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.testName, func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + collect := make(chan *monitoring.RawLog, 2) + processed := make(chan *pb.Event, 2) + + log := logrus.New() + log.SetLevel(logrus.DebugLevel) + + p, err := GetClient(&Config{ + Logger: log.WithField("extension", "test"), + Workers: numWorkers, + }) + if err != nil { + t.Fatalf("Could not get a Processor Client: %s", err) + } + + wg := &sync.WaitGroup{} + + wg.Add(1) + // Start Processor + go p.Process(ctx, wg, collect, processed) + + // Briefly sleep so map can be reconciled before event is collected + // and processed + if !tc.fileExists { + time.Sleep(2 * time.Second) + } + + input, err := os.ReadFile(tc.testFile) + if err != nil { + t.Fatalf("Error while reading the logfile %s: %v", tc.testFile, err) + } + + collect <- &monitoring.RawLog{Origin: monitoring.NAP, Logline: string(input)} + + select { + case event := <-processed: + t.Logf("Got event: %v", event) + case <-time.After(eventWaitTimeout * time.Second): + // for negative test, there should not be an event generated. + if !tc.isNegative { + t.Error("Should receive security violation event, and should not be timeout.") + } + } + }) + } +} diff --git a/src/extensions/nginx-app-protect/monitoring/processor/testdata/expanded_nap_waf.log.txt b/src/extensions/nginx-app-protect/monitoring/processor/testdata/expanded_nap_waf.log.txt new file mode 100644 index 000000000..f6a9569b9 --- /dev/null +++ b/src/extensions/nginx-app-protect/monitoring/processor/testdata/expanded_nap_waf.log.txt @@ -0,0 +1 @@ +2022-04-19 17:12:31,N/A,80,127.0.0.1,,GET,app_protect_default_policy,HTTP,blocked,0,Critical,::,200001475::200000098,XSS script tag end (Parameter) (2)::XSS script tag (Parameter),{Cross Site Scripting Signatures;High Accuracy Signatures}::{Cross Site Scripting Signatures;High Accuracy Signatures},61478,HTTP protocol compliance failed:Host header contains IP address,4355056874564592513,N/A,unit-hostname,/,5,1-localhost:1-/,N/A,REJECTED,SECURITY_WAF_VIOLATION,HTTP protocol compliance failed::Illegal meta character in value::Attack signature detected::Violation Rating Threat detected::Bot Client Detected,410000000200c00-3a03030c30000072-8000000000000000-0477f0ffcbbd0fea-befbf35cb000007e-8000000000000000-00-20-0-00-0-0-042VIOL_ATTACK_SIGNATUREparameterglobalYQ==alpha-numericPHNjcmlwdD4=query*002000014753YT08c2NyaXB0Pg==372000000983YT08c2NyaXB0Pg==2714VIOL_HTTP_PROTOCOL20482048SG9zdCBoZWFkZXIgd2l0aCBJUCB2YWx1ZTogMTAuMTQ2LjE3OS4xMTk=24VIOL_PARAMETER_VALUE_METACHARglobalYQ==alpha-numericPHNjcmlwdD4=query*046062,curl,HTTP Library,N/A,N/A,Untrusted Bot,N/A,N/A,GET /?a=