Skip to content

Commit dacced5

Browse files
committed
fix: fixes for nap monitoring extension
1 parent a4ebf3a commit dacced5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1365
-2758
lines changed

sdk/proto/events/event.pb.go

Lines changed: 307 additions & 740 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/proto/events/event.proto

Lines changed: 51 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -47,67 +47,57 @@ message ActivityEvent {
4747

4848
// SecurityViolationEvent represents a Security Violation that is emitted by the Agent
4949
message SecurityViolationEvent {
50-
string DateTime = 1 [(gogoproto.jsontag) = "date_time" ];
51-
string PolicyName = 2 [(gogoproto.jsontag) = "policy_name" ];
52-
string SupportID = 3 [(gogoproto.jsontag) = "support_id" ];
53-
54-
string Outcome = 4 [(gogoproto.jsontag) = "outcome" ];
55-
string OutcomeReason = 5 [(gogoproto.jsontag) = "outcome_reason" ];
56-
string BlockingExceptionReason = 6 [(gogoproto.jsontag) = "blocking_exception_reason" ];
57-
58-
string Method = 7 [(gogoproto.jsontag) = "method" ];
59-
string Protocol = 8 [(gogoproto.jsontag) = "protocol" ];
60-
string XForwardedForHeaderValue = 9 [(gogoproto.jsontag) = "xff_header_value" ];
61-
62-
string URI = 10 [(gogoproto.jsontag) = "uri" ];
63-
string Request = 11 [(gogoproto.jsontag) = "request" ];
64-
string IsTruncated = 12 [(gogoproto.jsontag) = "is_truncated" ];
65-
string RequestStatus = 13 [(gogoproto.jsontag) = "request_status" ];
66-
string ResponseCode = 14 [(gogoproto.jsontag) = "response_code" ];
67-
68-
string GeoIP = 15 [(gogoproto.jsontag) = "geo_ip" ];
69-
string Host = 16 [(gogoproto.jsontag) = "host" ];
70-
string UnitHostname = 17 [(gogoproto.jsontag) = "unit_hostname" ];
71-
string SourceHost = 18 [(gogoproto.jsontag) = "source_host" ];
72-
string VSName = 19 [(gogoproto.jsontag) = "vs_name" ];
73-
string IPClient = 20 [(gogoproto.jsontag) = "ip_client" ];
74-
string DestinationPort = 21 [(gogoproto.jsontag) = "destination_port" ];
75-
string SourcePort = 22 [(gogoproto.jsontag) = "source_port" ];
76-
77-
string Violations = 23 [(gogoproto.jsontag) = "violations" ];
78-
string SubViolations = 24 [(gogoproto.jsontag) = "sub_violations" ];
79-
string ViolationRating = 25 [(gogoproto.jsontag) = "violation_rating" ];
80-
81-
string SigID = 26 [(gogoproto.jsontag) = "sig_id" ];
82-
string SigNames = 27 [(gogoproto.jsontag) = "sig_names" ];
83-
string SigSetNames = 28 [(gogoproto.jsontag) = "sig_set_names" ];
84-
string SigCVEs = 29 [(gogoproto.jsontag) = "sig_cves" ];
85-
86-
string ClientClass = 30 [(gogoproto.jsontag) = "client_class" ];
87-
string ClientApplication = 31 [(gogoproto.jsontag) = "client_application" ];
88-
string ClientApplicationVersion = 32 [(gogoproto.jsontag) = "client_application_version" ];
89-
90-
string Severity = 33 [(gogoproto.jsontag) = "severity" ];
91-
// NOTE: Severity Label might be deprecated if we have no use for it
92-
string SeverityLabel = 34 [(gogoproto.jsontag) = "severity_label" ];
93-
string Priority = 35 [(gogoproto.jsontag) = "priority" ];
94-
95-
string ThreatCampaignNames = 36 [(gogoproto.jsontag) = "threat_campaign_names" ];
96-
97-
string BotAnomalies = 37 [(gogoproto.jsontag) = "bot_anomalies" ];
98-
string BotCategory = 38 [(gogoproto.jsontag) = "bot_category" ];
99-
string EnforcedBotAnomalies = 39 [(gogoproto.jsontag) = "enforced_bot_anomalies" ];
100-
string BotSignatureName = 40 [(gogoproto.jsontag) = "bot_signature_name" ];
101-
102-
string ViolationContexts = 41 [(gogoproto.jsontag) = "violation_contexts" ];
103-
repeated ViolationData ViolationsData = 42 [(gogoproto.jsontag) = "violations_data" ];
104-
105-
string SystemID = 43 [(gogoproto.jsontag) = "system_id" ];
106-
string Hostname = 44 [(gogoproto.jsontag) = "hostname" ];
107-
string InstanceTags = 45 [(gogoproto.jsontag) = "instance_tags" ];
108-
string InstanceGroup = 46 [(gogoproto.jsontag) = "instance_group" ];
109-
string DisplayName = 47 [(gogoproto.jsontag) = "display_name" ];
110-
string NginxID = 48 [(gogoproto.jsontag) = "nginx_id" ];
50+
string PolicyName = 1 [(gogoproto.jsontag) = "policy_name" ];
51+
string SupportID = 2 [(gogoproto.jsontag) = "support_id" ];
52+
53+
string Outcome = 3 [(gogoproto.jsontag) = "outcome" ];
54+
string OutcomeReason = 4 [(gogoproto.jsontag) = "outcome_reason" ];
55+
string BlockingExceptionReason = 5 [(gogoproto.jsontag) = "blocking_exception_reason" ];
56+
57+
string Method = 6 [(gogoproto.jsontag) = "method" ];
58+
string Protocol = 7 [(gogoproto.jsontag) = "protocol" ];
59+
string XForwardedForHeaderValue = 8 [(gogoproto.jsontag) = "xff_header_value" ];
60+
61+
string URI = 9 [(gogoproto.jsontag) = "uri" ];
62+
string Request = 10 [(gogoproto.jsontag) = "request" ];
63+
string IsTruncated = 11 [(gogoproto.jsontag) = "is_truncated" ];
64+
string RequestStatus = 12 [(gogoproto.jsontag) = "request_status" ];
65+
string ResponseCode = 13 [(gogoproto.jsontag) = "response_code" ];
66+
67+
string ServerAddr = 14 [(gogoproto.jsontag) = "server_addr" ];
68+
string VSName = 15 [(gogoproto.jsontag) = "vs_name" ];
69+
string RemoteAddr = 16[(gogoproto.jsontag) = "remote_addr" ];
70+
string RemotePort = 17 [(gogoproto.jsontag) = "destination_port" ];
71+
string ServerPort = 18 [(gogoproto.jsontag) = "server_port" ];
72+
73+
string Violations = 19 [(gogoproto.jsontag) = "violations" ];
74+
string SubViolations = 20 [(gogoproto.jsontag) = "sub_violations" ];
75+
string ViolationRating = 21 [(gogoproto.jsontag) = "violation_rating" ];
76+
77+
string SigSetNames = 22 [(gogoproto.jsontag) = "sig_set_names" ];
78+
string SigCVEs = 23 [(gogoproto.jsontag) = "sig_cves" ];
79+
80+
string ClientClass = 24 [(gogoproto.jsontag) = "client_class" ];
81+
string ClientApplication = 25 [(gogoproto.jsontag) = "client_application" ];
82+
string ClientApplicationVersion = 26 [(gogoproto.jsontag) = "client_application_version" ];
83+
84+
string Severity = 27 [(gogoproto.jsontag) = "severity" ];
85+
string ThreatCampaignNames = 28 [(gogoproto.jsontag) = "threat_campaign_names" ];
86+
87+
string BotAnomalies = 29 [(gogoproto.jsontag) = "bot_anomalies" ];
88+
string BotCategory = 30 [(gogoproto.jsontag) = "bot_category" ];
89+
string EnforcedBotAnomalies = 31 [(gogoproto.jsontag) = "enforced_bot_anomalies" ];
90+
string BotSignatureName = 32 [(gogoproto.jsontag) = "bot_signature_name" ];
91+
92+
string ViolationContexts = 33 [(gogoproto.jsontag) = "violation_contexts" ];
93+
repeated ViolationData ViolationsData = 34 [(gogoproto.jsontag) = "violations_data" ];
94+
95+
string SystemID = 35 [(gogoproto.jsontag) = "system_id" ];
96+
string InstanceTags = 36 [(gogoproto.jsontag) = "instance_tags" ];
97+
string InstanceGroup = 37 [(gogoproto.jsontag) = "instance_group" ];
98+
string DisplayName = 38 [(gogoproto.jsontag) = "display_name" ];
99+
string NginxID = 39 [(gogoproto.jsontag) = "nginx_id" ];
100+
string ParentHostname = 40 [(gogoproto.jsontag) = "parent_hostname" ];
111101
}
112102

113103
message SignatureData {

src/extensions/nginx-app-protect/monitoring/collector/nap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (nap *NAPCollector) Collect(ctx context.Context, wg *sync.WaitGroup, collec
9393
break
9494
}
9595

96-
nap.logger.Infof("collected log line succesfully.")
96+
nap.logger.Tracef("collected log line succesfully: %v", line)
9797
collect <- &monitoring.RawLog{Origin: monitoring.NAP, Logline: line}
9898
case <-ctx.Done():
9999
nap.logger.Infof("Context cancellation, collector is wrapping up...")

src/extensions/nginx-app-protect/monitoring/manager/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
const (
19-
componentName = "security-events-manager"
19+
componentName = "nginx-app-protect-monitoring"
2020
defaultCollectorBufferSize = 50000
2121
defaultProcessorBufferSize = 50000
2222
)

0 commit comments

Comments
 (0)