mirror of
https://github.com/netbirdio/netbird.git
synced 2026-07-16 11:39:57 +00:00
* added an implementation of aggregating memory store Signed-off-by: Dmitri <dmitri.external@netbird.io> * initial support for aggregation of events Signed-off-by: Dmitri <dmitri.external@netbird.io> * added tcp-aggregation test Signed-off-by: Dmitri <dmitri.external@netbird.io> * added manager integration test Signed-off-by: Dmitri <dmitri.external@netbird.io> * added tracking of the number of start-, drop, and end-events in an aggregation window Signed-off-by: Dmitri <dmitri.external@netbird.io> * fixes based on sonarcube checks Signed-off-by: Dmitri <dmitri.external@netbird.io> * regenerated proto files Signed-off-by: Dmitri <dmitri.external@netbird.io> * removed inadvertenly added google proto files Signed-off-by: Dmitri <dmitri.external@netbird.io> * pacifying linter Signed-off-by: Dmitri <dmitri.external@netbird.io> * update test to validate event aggregation over tcp, udp, icmp, and icmpv6 Signed-off-by: Dmitri <dmitri.external@netbird.io> * updated event aggregation test Signed-off-by: Dmitri <dmitri.external@netbird.io> * regenerate protobufs with expected versions of protoc and protoc-gen-go Signed-off-by: Dmitri <dmitri.external@netbird.io> * remove protoc/protoc-gen headers from flow_grpc.pb.go Signed-off-by: Dmitri <dmitri.external@netbird.io> * updated openapi spec Signed-off-by: Dmitri <dmitri.external@netbird.io> * updated openapi NetworkTrafficEvent spec, regenerated types Signed-off-by: Dmitri <dmitri.external@netbird.io> * respond to feedback Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * fixed an issue with how we track events that shouldn't be aggregated Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * fixed mapping of events to protobuf Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * icmp code values in aggregated events do not matter Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * regenerate openapi types Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * added a comment re: unbounded unacked events Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * reset aggregated event type to unknown Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * fix event aggregation test Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * used the source port of the earliest event Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * add tracking of window starts and ends Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * updated openapi spec Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * reverted changes to generate.sh Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * cleanup handling of not-aggregated events + test Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * responded to feedback + small fixes Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * small fix in a test Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * another test Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * force setting non-empty rule id on aggregated events Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * fixed a couple of issues flagged by coderabbit Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * fix spelling Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> * handle exhausted retry backoffs Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io> --------- Signed-off-by: Dmitri <dmitri.external@netbird.io> Signed-off-by: Dmitri Dolguikh <dmitri.external@netbird.io>
112 lines
2.0 KiB
Protocol Buffer
112 lines
2.0 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
option go_package = "/proto";
|
|
|
|
package flow;
|
|
|
|
service FlowService {
|
|
// Client to receiver streams of events and acknowledgements
|
|
rpc Events(stream FlowEvent) returns (stream FlowEventAck) {}
|
|
}
|
|
|
|
message FlowEvent {
|
|
// Unique client event identifier
|
|
bytes event_id = 1;
|
|
|
|
// When the event occurred
|
|
google.protobuf.Timestamp timestamp = 2;
|
|
|
|
// Public key of the sending peer
|
|
bytes public_key = 3;
|
|
|
|
FlowFields flow_fields = 4;
|
|
|
|
bool isInitiator = 5;
|
|
|
|
google.protobuf.Timestamp window_start = 6;
|
|
google.protobuf.Timestamp window_end = 7;
|
|
}
|
|
|
|
message FlowEventAck {
|
|
// Unique client event identifier that has been ack'ed
|
|
bytes event_id = 1;
|
|
bool isInitiator = 2;
|
|
}
|
|
|
|
message FlowFields {
|
|
// Unique client flow session identifier
|
|
bytes flow_id = 1;
|
|
|
|
// Flow type
|
|
Type type = 2;
|
|
|
|
// RuleId identifies the rule that allowed or denied the connection
|
|
bytes rule_id = 3;
|
|
|
|
// Initiating traffic direction
|
|
Direction direction = 4;
|
|
|
|
// IP protocol number
|
|
uint32 protocol = 5;
|
|
|
|
// Source IP address
|
|
bytes source_ip = 6;
|
|
|
|
// Destination IP address
|
|
bytes dest_ip = 7;
|
|
|
|
// Layer 4 -specific information
|
|
oneof connection_info {
|
|
// TCP/UDP port information
|
|
PortInfo port_info = 8;
|
|
|
|
// ICMP type and code
|
|
ICMPInfo icmp_info = 9;
|
|
}
|
|
|
|
// Number of packets
|
|
uint64 rx_packets = 10;
|
|
uint64 tx_packets = 11;
|
|
|
|
// Number of bytes
|
|
uint64 rx_bytes = 12;
|
|
uint64 tx_bytes = 13;
|
|
|
|
// Resource ID
|
|
bytes source_resource_id = 14;
|
|
bytes dest_resource_id = 15;
|
|
|
|
uint64 num_of_starts = 16;
|
|
uint64 num_of_ends = 17;
|
|
uint64 num_of_drops = 18;
|
|
}
|
|
|
|
// Flow event types
|
|
enum Type {
|
|
TYPE_UNKNOWN = 0;
|
|
TYPE_START = 1;
|
|
TYPE_END = 2;
|
|
TYPE_DROP = 3;
|
|
}
|
|
|
|
// Flow direction
|
|
enum Direction {
|
|
DIRECTION_UNKNOWN = 0;
|
|
INGRESS = 1;
|
|
EGRESS = 2;
|
|
}
|
|
|
|
// TCP/UDP port information
|
|
message PortInfo {
|
|
uint32 source_port = 1;
|
|
uint32 dest_port = 2;
|
|
}
|
|
|
|
// ICMP message information
|
|
message ICMPInfo {
|
|
uint32 icmp_type = 1;
|
|
uint32 icmp_code = 2;
|
|
}
|