eventsv1

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Phase_name = map[int32]string{
		0: "PHASE_UNSPECIFIED",
		1: "PHASE_REQUEST",
		2: "PHASE_RESPONSE",
		3: "PHASE_WEBSOCKET_MESSAGE",
	}
	Phase_value = map[string]int32{
		"PHASE_UNSPECIFIED":       0,
		"PHASE_REQUEST":           1,
		"PHASE_RESPONSE":          2,
		"PHASE_WEBSOCKET_MESSAGE": 3,
	}
)

Enum value maps for Phase.

View Source
var (
	Protocol_name = map[int32]string{
		0: "PROTOCOL_UNSPECIFIED",
		1: "PROTOCOL_HTTP",
		2: "PROTOCOL_GRPC",
		3: "PROTOCOL_WEBSOCKET",
	}
	Protocol_value = map[string]int32{
		"PROTOCOL_UNSPECIFIED": 0,
		"PROTOCOL_HTTP":        1,
		"PROTOCOL_GRPC":        2,
		"PROTOCOL_WEBSOCKET":   3,
	}
)

Enum value maps for Protocol.

View Source
var File_events_v1_events_proto protoreflect.FileDescriptor
View Source
var File_events_v1_stats_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type EventBatch

type EventBatch struct {
	Events []*SecurityEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// Events dropped since the previous batch (a full buffer drops the
	// oldest), so a gap is visible.
	Dropped uint64 `protobuf:"varint,2,opt,name=dropped,proto3" json:"dropped,omitempty"`
	// contains filtered or unexported fields
}

EventBatch carries events in order of time.

func (*EventBatch) Descriptor deprecated

func (*EventBatch) Descriptor() ([]byte, []int)

Deprecated: Use EventBatch.ProtoReflect.Descriptor instead.

func (*EventBatch) GetDropped

func (x *EventBatch) GetDropped() uint64

func (*EventBatch) GetEvents

func (x *EventBatch) GetEvents() []*SecurityEvent

func (*EventBatch) ProtoMessage

func (*EventBatch) ProtoMessage()

func (*EventBatch) ProtoReflect

func (x *EventBatch) ProtoReflect() protoreflect.Message

func (*EventBatch) Reset

func (x *EventBatch) Reset()

func (*EventBatch) String

func (x *EventBatch) String() string

type Match

type Match struct {
	RuleId int32 `protobuf:"varint,1,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"`
	// Where it matched, e.g. ARGS:id or REQUEST_HEADERS:User-Agent; at most
	// 128.
	Variable string `protobuf:"bytes,2,opt,name=variable,proto3" json:"variable,omitempty"`
	// At most 64 bytes of the matched value, redacted: none from a
	// response body, which is the leaked data itself.
	Snippet string `protobuf:"bytes,3,opt,name=snippet,proto3" json:"snippet,omitempty"`
	// contains filtered or unexported fields
}

Match is one rule that matched.

func (*Match) Descriptor deprecated

func (*Match) Descriptor() ([]byte, []int)

Deprecated: Use Match.ProtoReflect.Descriptor instead.

func (*Match) GetRuleId

func (x *Match) GetRuleId() int32

func (*Match) GetSnippet

func (x *Match) GetSnippet() string

func (*Match) GetVariable

func (x *Match) GetVariable() string

func (*Match) ProtoMessage

func (*Match) ProtoMessage()

func (*Match) ProtoReflect

func (x *Match) ProtoReflect() protoreflect.Message

func (*Match) Reset

func (x *Match) Reset()

func (*Match) String

func (x *Match) String() string

type Phase added in v0.4.0

type Phase int32

Phase is the part of the exchange an event is about.

const (
	Phase_PHASE_UNSPECIFIED Phase = 0
	// The client's request.
	Phase_PHASE_REQUEST Phase = 1
	// The upstream's response: a deny replaced it.
	Phase_PHASE_RESPONSE Phase = 2
	// A message the client sent on a WebSocket (the engine's proxy with
	// --websocket-messages); the request fields are its handshake's.
	Phase_PHASE_WEBSOCKET_MESSAGE Phase = 3
)

func (Phase) Descriptor added in v0.4.0

func (Phase) Descriptor() protoreflect.EnumDescriptor

func (Phase) Enum added in v0.4.0

func (x Phase) Enum() *Phase

func (Phase) EnumDescriptor deprecated added in v0.4.0

func (Phase) EnumDescriptor() ([]byte, []int)

Deprecated: Use Phase.Descriptor instead.

func (Phase) Number added in v0.4.0

func (x Phase) Number() protoreflect.EnumNumber

func (Phase) String added in v0.4.0

func (x Phase) String() string

func (Phase) Type added in v0.4.0

func (Phase) Type() protoreflect.EnumType

type PolicyStats added in v0.3.0

type PolicyStats struct {

	// "namespace/name".
	Policy string `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"`
	// Forwarded: clean, on a skipped path, or not inspected under a fail-open
	// policy.
	Allowed uint64 `protobuf:"varint,2,opt,name=allowed,proto3" json:"allowed,omitempty"`
	// Rejected (block mode).
	Denied uint64 `protobuf:"varint,3,opt,name=denied,proto3" json:"denied,omitempty"`
	// Forwarded, but would have been rejected (detect mode).
	Detected uint64 `protobuf:"varint,4,opt,name=detected,proto3" json:"detected,omitempty"`
	// Requests per latency bucket (time spent inspecting), one count per
	// bound of RequestStats.latency_bounds and a last one for slower
	// requests. Not cumulative across buckets.
	LatencyCounts []uint64 `protobuf:"varint,5,rep,packed,name=latency_counts,json=latencyCounts,proto3" json:"latency_counts,omitempty"`
	// The sum of their latencies, in seconds.
	LatencySum float64 `protobuf:"fixed64,6,opt,name=latency_sum,json=latencySum,proto3" json:"latency_sum,omitempty"`
	// contains filtered or unexported fields
}

PolicyStats counts the requests one policy decided. Their total is allowed + denied + detected. Requests no policy covers aren't counted.

func (*PolicyStats) Descriptor deprecated added in v0.3.0

func (*PolicyStats) Descriptor() ([]byte, []int)

Deprecated: Use PolicyStats.ProtoReflect.Descriptor instead.

func (*PolicyStats) GetAllowed added in v0.3.0

func (x *PolicyStats) GetAllowed() uint64

func (*PolicyStats) GetDenied added in v0.3.0

func (x *PolicyStats) GetDenied() uint64

func (*PolicyStats) GetDetected added in v0.3.0

func (x *PolicyStats) GetDetected() uint64

func (*PolicyStats) GetLatencyCounts added in v0.3.0

func (x *PolicyStats) GetLatencyCounts() []uint64

func (*PolicyStats) GetLatencySum added in v0.3.0

func (x *PolicyStats) GetLatencySum() float64

func (*PolicyStats) GetPolicy added in v0.3.0

func (x *PolicyStats) GetPolicy() string

func (*PolicyStats) ProtoMessage added in v0.3.0

func (*PolicyStats) ProtoMessage()

func (*PolicyStats) ProtoReflect added in v0.3.0

func (x *PolicyStats) ProtoReflect() protoreflect.Message

func (*PolicyStats) Reset added in v0.3.0

func (x *PolicyStats) Reset()

func (*PolicyStats) String added in v0.3.0

func (x *PolicyStats) String() string

type Protocol added in v0.5.0

type Protocol int32

Protocol is what the request speaks.

const (
	Protocol_PROTOCOL_UNSPECIFIED Protocol = 0
	Protocol_PROTOCOL_HTTP        Protocol = 1
	// gRPC (Content-Type application/grpc).
	Protocol_PROTOCOL_GRPC Protocol = 2
	// A WebSocket: its handshake, or one of its messages.
	Protocol_PROTOCOL_WEBSOCKET Protocol = 3
)

func (Protocol) Descriptor added in v0.5.0

func (Protocol) Descriptor() protoreflect.EnumDescriptor

func (Protocol) Enum added in v0.5.0

func (x Protocol) Enum() *Protocol

func (Protocol) EnumDescriptor deprecated added in v0.5.0

func (Protocol) EnumDescriptor() ([]byte, []int)

Deprecated: Use Protocol.Descriptor instead.

func (Protocol) Number added in v0.5.0

func (x Protocol) Number() protoreflect.EnumNumber

func (Protocol) String added in v0.5.0

func (x Protocol) String() string

func (Protocol) Type added in v0.5.0

type RequestStats added in v0.3.0

type RequestStats struct {

	// The upper bounds of the latency buckets, in seconds, increasing.
	LatencyBounds []float64 `protobuf:"fixed64,1,rep,packed,name=latency_bounds,json=latencyBounds,proto3" json:"latency_bounds,omitempty"`
	// The policies that counted requests; a policy is in at most one message
	// of a report.
	Policies []*PolicyStats `protobuf:"bytes,2,rep,name=policies,proto3" json:"policies,omitempty"`
	// contains filtered or unexported fields
}

RequestStats counts requests per policy. The counts are cumulative; where they start is up to the message carrying them. A policy's count lower than in the previous report is a reset: count the new value from zero.

func (*RequestStats) Descriptor deprecated added in v0.3.0

func (*RequestStats) Descriptor() ([]byte, []int)

Deprecated: Use RequestStats.ProtoReflect.Descriptor instead.

func (*RequestStats) GetLatencyBounds added in v0.3.0

func (x *RequestStats) GetLatencyBounds() []float64

func (*RequestStats) GetPolicies added in v0.3.0

func (x *RequestStats) GetPolicies() []*PolicyStats

func (*RequestStats) ProtoMessage added in v0.3.0

func (*RequestStats) ProtoMessage()

func (*RequestStats) ProtoReflect added in v0.3.0

func (x *RequestStats) ProtoReflect() protoreflect.Message

func (*RequestStats) Reset added in v0.3.0

func (x *RequestStats) Reset()

func (*RequestStats) String added in v0.3.0

func (x *RequestStats) String() string

type SecurityEvent

type SecurityEvent struct {

	// Unique per event (a ULID): repeated sends of the same event are
	// deduplicated by it.
	EventId string                 `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	Time    *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"`
	// The engine that inspected the request, and its pod.
	EngineId     string `protobuf:"bytes,3,opt,name=engine_id,json=engineId,proto3" json:"engine_id,omitempty"`
	PodNamespace string `protobuf:"bytes,4,opt,name=pod_namespace,json=podNamespace,proto3" json:"pod_namespace,omitempty"`
	PodName      string `protobuf:"bytes,5,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"`
	// The policy that decided, "namespace/name", and the bundle it came from.
	Policy        string    `protobuf:"bytes,6,opt,name=policy,proto3" json:"policy,omitempty"`
	BundleVersion uint64    `protobuf:"varint,7,opt,name=bundle_version,json=bundleVersion,proto3" json:"bundle_version,omitempty"`
	Action        v1.Action `protobuf:"varint,8,opt,name=action,proto3,enum=inkwall.engine.v1.Action" json:"action,omitempty"`
	Reason        v1.Reason `protobuf:"varint,9,opt,name=reason,proto3,enum=inkwall.engine.v1.Reason" json:"reason,omitempty"`
	// The rule that interrupted the request, if any.
	InterruptingRuleId int32 `protobuf:"varint,10,opt,name=interrupting_rule_id,json=interruptingRuleId,proto3" json:"interrupting_rule_id,omitempty"`
	// Every rule that matched, including score-only matches.
	Matches []*Match `protobuf:"bytes,11,rep,name=matches,proto3" json:"matches,omitempty"`
	// The CRS inbound anomaly score.
	AnomalyScore int32 `protobuf:"varint,12,opt,name=anomaly_score,json=anomalyScore,proto3" json:"anomaly_score,omitempty"`
	// The request, without its query string or body.
	Method string `protobuf:"bytes,13,opt,name=method,proto3" json:"method,omitempty"`
	// At most 255.
	Host string `protobuf:"bytes,14,opt,name=host,proto3" json:"host,omitempty"`
	// As received (percent-encoded), without the query string; at most 1,024.
	Path string `protobuf:"bytes,15,opt,name=path,proto3" json:"path,omitempty"`
	// The client's address after the trusted proxies (0002 §8.2).
	ClientIp string `protobuf:"bytes,16,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"`
	// At most 256.
	UserAgent string `protobuf:"bytes,17,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"`
	// The proxy's request ID, to find the request in its logs; at most 128
	// (often from a header the client can set).
	RequestId string `protobuf:"bytes,18,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// The status the client got (0 when the request was forwarded and the
	// response isn't known).
	Status int32 `protobuf:"varint,19,opt,name=status,proto3" json:"status,omitempty"`
	// Time spent inspecting.
	Latency *durationpb.Duration `protobuf:"bytes,20,opt,name=latency,proto3" json:"latency,omitempty"`
	// What was inspected: the request, or the upstream's response to it
	// (for a policy that inspects responses). Unset in events of engines
	// before 0.4.0: the request.
	Phase Phase `protobuf:"varint,21,opt,name=phase,proto3,enum=inkwall.events.v1.Phase" json:"phase,omitempty"`
	// The protocol the request speaks: a WebSocket's handshake and messages
	// are PROTOCOL_WEBSOCKET. Unspecified from engines before v0.5.0.
	Protocol Protocol `protobuf:"varint,22,opt,name=protocol,proto3,enum=inkwall.events.v1.Protocol" json:"protocol,omitempty"`
	// contains filtered or unexported fields
}

SecurityEvent is one blocked or detected request. The request's fields are attacker-controlled: they are truncated to their limits (in bytes) in the engine, and must be escaped wherever they are shown.

func (*SecurityEvent) Descriptor deprecated

func (*SecurityEvent) Descriptor() ([]byte, []int)

Deprecated: Use SecurityEvent.ProtoReflect.Descriptor instead.

func (*SecurityEvent) GetAction

func (x *SecurityEvent) GetAction() v1.Action

func (*SecurityEvent) GetAnomalyScore

func (x *SecurityEvent) GetAnomalyScore() int32

func (*SecurityEvent) GetBundleVersion

func (x *SecurityEvent) GetBundleVersion() uint64

func (*SecurityEvent) GetClientIp

func (x *SecurityEvent) GetClientIp() string

func (*SecurityEvent) GetEngineId

func (x *SecurityEvent) GetEngineId() string

func (*SecurityEvent) GetEventId

func (x *SecurityEvent) GetEventId() string

func (*SecurityEvent) GetHost

func (x *SecurityEvent) GetHost() string

func (*SecurityEvent) GetInterruptingRuleId

func (x *SecurityEvent) GetInterruptingRuleId() int32

func (*SecurityEvent) GetLatency

func (x *SecurityEvent) GetLatency() *durationpb.Duration

func (*SecurityEvent) GetMatches

func (x *SecurityEvent) GetMatches() []*Match

func (*SecurityEvent) GetMethod

func (x *SecurityEvent) GetMethod() string

func (*SecurityEvent) GetPath

func (x *SecurityEvent) GetPath() string

func (*SecurityEvent) GetPhase added in v0.4.0

func (x *SecurityEvent) GetPhase() Phase

func (*SecurityEvent) GetPodName

func (x *SecurityEvent) GetPodName() string

func (*SecurityEvent) GetPodNamespace

func (x *SecurityEvent) GetPodNamespace() string

func (*SecurityEvent) GetPolicy

func (x *SecurityEvent) GetPolicy() string

func (*SecurityEvent) GetProtocol added in v0.5.0

func (x *SecurityEvent) GetProtocol() Protocol

func (*SecurityEvent) GetReason

func (x *SecurityEvent) GetReason() v1.Reason

func (*SecurityEvent) GetRequestId

func (x *SecurityEvent) GetRequestId() string

func (*SecurityEvent) GetStatus

func (x *SecurityEvent) GetStatus() int32

func (*SecurityEvent) GetTime

func (x *SecurityEvent) GetTime() *timestamppb.Timestamp

func (*SecurityEvent) GetUserAgent

func (x *SecurityEvent) GetUserAgent() string

func (*SecurityEvent) ProtoMessage

func (*SecurityEvent) ProtoMessage()

func (*SecurityEvent) ProtoReflect

func (x *SecurityEvent) ProtoReflect() protoreflect.Message

func (*SecurityEvent) Reset

func (x *SecurityEvent) Reset()

func (*SecurityEvent) String

func (x *SecurityEvent) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL