enginev1

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 10 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

View Source
const (
	CheckService_Check_FullMethodName = "/inkwall.engine.v1.CheckService/Check"
)

Variables

View Source
var (
	Action_name = map[int32]string{
		0: "ACTION_UNSPECIFIED",
		1: "ACTION_ALLOW",
		2: "ACTION_DENY",
		3: "ACTION_LOG",
	}
	Action_value = map[string]int32{
		"ACTION_UNSPECIFIED": 0,
		"ACTION_ALLOW":       1,
		"ACTION_DENY":        2,
		"ACTION_LOG":         3,
	}
)

Enum value maps for Action.

View Source
var (
	Reason_name = map[int32]string{
		0:  "REASON_UNSPECIFIED",
		1:  "REASON_NONE",
		2:  "REASON_RULE",
		3:  "REASON_TIMEOUT",
		4:  "REASON_ERROR",
		5:  "REASON_CANCELED",
		6:  "REASON_OVERLOAD",
		7:  "REASON_OVERSIZE",
		8:  "REASON_SKIPPED",
		9:  "REASON_NO_POLICY",
		10: "REASON_SUSPENDED",
		11: "REASON_WEBSOCKET",
		12: "REASON_IP_DENY",
		13: "REASON_IP_ALLOW",
		14: "REASON_GRPC",
	}
	Reason_value = map[string]int32{
		"REASON_UNSPECIFIED": 0,
		"REASON_NONE":        1,
		"REASON_RULE":        2,
		"REASON_TIMEOUT":     3,
		"REASON_ERROR":       4,
		"REASON_CANCELED":    5,
		"REASON_OVERLOAD":    6,
		"REASON_OVERSIZE":    7,
		"REASON_SKIPPED":     8,
		"REASON_NO_POLICY":   9,
		"REASON_SUSPENDED":   10,
		"REASON_WEBSOCKET":   11,
		"REASON_IP_DENY":     12,
		"REASON_IP_ALLOW":    13,
		"REASON_GRPC":        14,
	}
)

Enum value maps for Reason.

View Source
var CheckService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "inkwall.engine.v1.CheckService",
	HandlerType: (*CheckServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Check",
			Handler:    _CheckService_Check_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "engine/v1/engine.proto",
}

CheckService_ServiceDesc is the grpc.ServiceDesc for CheckService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_engine_v1_engine_proto protoreflect.FileDescriptor

Functions

func RegisterCheckServiceServer

func RegisterCheckServiceServer(s grpc.ServiceRegistrar, srv CheckServiceServer)

Types

type Action

type Action int32

Action tells the proxy what to do with the request.

const (
	Action_ACTION_UNSPECIFIED Action = 0
	// Forward the request.
	Action_ACTION_ALLOW Action = 1
	// Reject the request with CheckResponse.status.
	Action_ACTION_DENY Action = 2
	// Forward the request; it would have been blocked in block mode.
	Action_ACTION_LOG Action = 3
)

func (Action) Descriptor

func (Action) Descriptor() protoreflect.EnumDescriptor

func (Action) Enum

func (x Action) Enum() *Action

func (Action) EnumDescriptor deprecated

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

Deprecated: Use Action.Descriptor instead.

func (Action) Number

func (x Action) Number() protoreflect.EnumNumber

func (Action) String

func (x Action) String() string

func (Action) Type

func (Action) Type() protoreflect.EnumType

type CheckRequest

type CheckRequest struct {

	// Correlates the request across proxy, engine and events. Empty or unsafe
	// values (anything but 1-128 of [A-Za-z0-9._:-]) are replaced by a
	// generated ID, returned in CheckResponse.request_id.
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// HTTP method, e.g. "GET".
	Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
	// "http" or "https" as seen by the proxy. Empty means "http".
	Scheme string `protobuf:"bytes,3,opt,name=scheme,proto3" json:"scheme,omitempty"`
	// Request authority (Host header or :authority).
	Authority string `protobuf:"bytes,4,opt,name=authority,proto3" json:"authority,omitempty"`
	// Path and query exactly as received, before any normalization. Must be in
	// origin form ("/path?query") and must not contain a fragment.
	RawUri string `protobuf:"bytes,5,opt,name=raw_uri,json=rawUri,proto3" json:"raw_uri,omitempty"`
	// Request headers in received order. A Host header is ignored in favour of
	// authority. Send Content-Length and Transfer-Encoding as received: rules
	// check for their presence.
	Headers []*Header `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty"`
	// End client address after the proxy's own trusted-proxy resolution, e.g.
	// "203.0.113.7" or "2001:db8::1". Empty means peer_ip.
	ClientIp string `protobuf:"bytes,7,opt,name=client_ip,json=clientIp,proto3" json:"client_ip,omitempty"`
	// Address of the proxy's direct TCP peer.
	PeerIp string `protobuf:"bytes,8,opt,name=peer_ip,json=peerIp,proto3" json:"peer_ip,omitempty"`
	// Body prefix. Bytes beyond the engine's --max-body-bytes are dropped and
	// the body is treated as truncated.
	Body []byte `protobuf:"bytes,9,opt,name=body,proto3" json:"body,omitempty"`
	// The real body was longer than body.
	BodyTruncated bool `protobuf:"varint,10,opt,name=body_truncated,json=bodyTruncated,proto3" json:"body_truncated,omitempty"`
	// Reserved for selecting a policy by route once bundles exist; ignored.
	RouteHint string `protobuf:"bytes,11,opt,name=route_hint,json=routeHint,proto3" json:"route_hint,omitempty"`
	// Protocol version, e.g. "HTTP/1.1" or "HTTP/2.0". Empty means "HTTP/1.1".
	Protocol string `protobuf:"bytes,12,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// contains filtered or unexported fields
}

CheckRequest describes one client request as the proxy received it.

func (*CheckRequest) Descriptor deprecated

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

Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.

func (*CheckRequest) GetAuthority

func (x *CheckRequest) GetAuthority() string

func (*CheckRequest) GetBody

func (x *CheckRequest) GetBody() []byte

func (*CheckRequest) GetBodyTruncated

func (x *CheckRequest) GetBodyTruncated() bool

func (*CheckRequest) GetClientIp

func (x *CheckRequest) GetClientIp() string

func (*CheckRequest) GetHeaders

func (x *CheckRequest) GetHeaders() []*Header

func (*CheckRequest) GetMethod

func (x *CheckRequest) GetMethod() string

func (*CheckRequest) GetPeerIp

func (x *CheckRequest) GetPeerIp() string

func (*CheckRequest) GetProtocol

func (x *CheckRequest) GetProtocol() string

func (*CheckRequest) GetRawUri

func (x *CheckRequest) GetRawUri() string

func (*CheckRequest) GetRequestId

func (x *CheckRequest) GetRequestId() string

func (*CheckRequest) GetRouteHint

func (x *CheckRequest) GetRouteHint() string

func (*CheckRequest) GetScheme

func (x *CheckRequest) GetScheme() string

func (*CheckRequest) ProtoMessage

func (*CheckRequest) ProtoMessage()

func (*CheckRequest) ProtoReflect

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

func (*CheckRequest) Reset

func (x *CheckRequest) Reset()

func (*CheckRequest) String

func (x *CheckRequest) String() string

type CheckResponse

type CheckResponse struct {
	Action Action `protobuf:"varint,1,opt,name=action,proto3,enum=inkwall.engine.v1.Action" json:"action,omitempty"`
	// HTTP status to return to the client when action is ACTION_DENY.
	Status uint32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	// Headers to add to the forwarded request (allow, log) or to the denial.
	ResponseHeaders []*Header `protobuf:"bytes,3,rep,name=response_headers,json=responseHeaders,proto3" json:"response_headers,omitempty"`
	// Every rule that matched, including rules that only added to an anomaly
	// score.
	RuleIds []uint32 `protobuf:"varint,4,rep,packed,name=rule_ids,json=ruleIds,proto3" json:"rule_ids,omitempty"`
	Reason  Reason   `protobuf:"varint,5,opt,name=reason,proto3,enum=inkwall.engine.v1.Reason" json:"reason,omitempty"`
	// Rule that interrupted the request, or 0.
	InterruptingRuleId uint32 `protobuf:"varint,6,opt,name=interrupting_rule_id,json=interruptingRuleId,proto3" json:"interrupting_rule_id,omitempty"`
	// The request ID used in the engine's events.
	RequestId string `protobuf:"bytes,7,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// Time spent inspecting.
	InspectionTime *durationpb.Duration `protobuf:"bytes,8,opt,name=inspection_time,json=inspectionTime,proto3" json:"inspection_time,omitempty"`
	// The policy that decided, in bundle mode ("namespace/name"); empty when
	// none did (no policy covers the request, or inspection is suspended),
	// or outside bundle mode.
	Policy string `protobuf:"bytes,9,opt,name=policy,proto3" json:"policy,omitempty"`
	// Where the rules matched: each rule and the variable it matched (e.g.
	// ARGS:q), never the matched value. At most 32, variable names cut to
	// 128 bytes, as in security events.
	Matches []*RuleMatch `protobuf:"bytes,10,rep,name=matches,proto3" json:"matches,omitempty"`
	// The request's inbound anomaly score (the Core Rule Set's), 0 when no
	// rule added to it.
	AnomalyScore int32 `protobuf:"varint,11,opt,name=anomaly_score,json=anomalyScore,proto3" json:"anomaly_score,omitempty"`
	// contains filtered or unexported fields
}

CheckResponse is the verdict for one CheckRequest.

func (*CheckResponse) Descriptor deprecated

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

Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.

func (*CheckResponse) GetAction

func (x *CheckResponse) GetAction() Action

func (*CheckResponse) GetAnomalyScore added in v0.5.0

func (x *CheckResponse) GetAnomalyScore() int32

func (*CheckResponse) GetInspectionTime

func (x *CheckResponse) GetInspectionTime() *durationpb.Duration

func (*CheckResponse) GetInterruptingRuleId

func (x *CheckResponse) GetInterruptingRuleId() uint32

func (*CheckResponse) GetMatches added in v0.5.0

func (x *CheckResponse) GetMatches() []*RuleMatch

func (*CheckResponse) GetPolicy added in v0.1.1

func (x *CheckResponse) GetPolicy() string

func (*CheckResponse) GetReason

func (x *CheckResponse) GetReason() Reason

func (*CheckResponse) GetRequestId

func (x *CheckResponse) GetRequestId() string

func (*CheckResponse) GetResponseHeaders

func (x *CheckResponse) GetResponseHeaders() []*Header

func (*CheckResponse) GetRuleIds

func (x *CheckResponse) GetRuleIds() []uint32

func (*CheckResponse) GetStatus

func (x *CheckResponse) GetStatus() uint32

func (*CheckResponse) ProtoMessage

func (*CheckResponse) ProtoMessage()

func (*CheckResponse) ProtoReflect

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

func (*CheckResponse) Reset

func (x *CheckResponse) Reset()

func (*CheckResponse) String

func (x *CheckResponse) String() string

type CheckServiceClient

type CheckServiceClient interface {
	// Check inspects one request and returns the verdict.
	Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
}

CheckServiceClient is the client API for CheckService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

CheckService is the gRPC form of POST /v1/check.

type CheckServiceServer

type CheckServiceServer interface {
	// Check inspects one request and returns the verdict.
	Check(context.Context, *CheckRequest) (*CheckResponse, error)
	// contains filtered or unexported methods
}

CheckServiceServer is the server API for CheckService service. All implementations must embed UnimplementedCheckServiceServer for forward compatibility.

CheckService is the gRPC form of POST /v1/check.

type Header struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Value, when it is valid UTF-8.
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// Value as raw bytes, for values that are not valid UTF-8 (obs-text).
	// Takes precedence over value when set.
	RawValue []byte `protobuf:"bytes,3,opt,name=raw_value,json=rawValue,proto3" json:"raw_value,omitempty"`
	// contains filtered or unexported fields
}

Header is one request or response header field.

func (*Header) Descriptor deprecated

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

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetName

func (x *Header) GetName() string

func (*Header) GetRawValue

func (x *Header) GetRawValue() []byte

func (*Header) GetValue

func (x *Header) GetValue() string

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

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

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

type Reason

type Reason int32

Reason explains a verdict.

const (
	Reason_REASON_UNSPECIFIED Reason = 0
	// No rule interrupted the request.
	Reason_REASON_NONE Reason = 1
	// A rule interrupted the request.
	Reason_REASON_RULE Reason = 2
	// Inspection exceeded the deadline.
	Reason_REASON_TIMEOUT Reason = 3
	// The evaluator failed.
	Reason_REASON_ERROR Reason = 4
	// The caller canceled the check.
	Reason_REASON_CANCELED Reason = 5
	// All evaluation slots were busy; the request was not inspected.
	Reason_REASON_OVERLOAD Reason = 6
	// The body was longer than the inspection limit.
	Reason_REASON_OVERSIZE Reason = 7
	// The route is configured to skip inspection.
	Reason_REASON_SKIPPED Reason = 8
	// No policy covers the route, so the request was not inspected.
	Reason_REASON_NO_POLICY Reason = 9
	// Inspection is suspended (the emergency switch).
	Reason_REASON_SUSPENDED Reason = 10
	// A WebSocket handshake didn't meet the policy's WebSocket rules (an
	// origin not allowed, a required header missing).
	Reason_REASON_WEBSOCKET Reason = 11
	// The client IP is in the policy's IP deny list.
	Reason_REASON_IP_DENY Reason = 12
	// The client IP is in the policy's IP allow list: not inspected.
	Reason_REASON_IP_ALLOW Reason = 13
	// A gRPC call on a policy that refuses gRPC (body.grpc: Deny).
	Reason_REASON_GRPC Reason = 14
)

func (Reason) Descriptor

func (Reason) Descriptor() protoreflect.EnumDescriptor

func (Reason) Enum

func (x Reason) Enum() *Reason

func (Reason) EnumDescriptor deprecated

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

Deprecated: Use Reason.Descriptor instead.

func (Reason) Number

func (x Reason) Number() protoreflect.EnumNumber

func (Reason) String

func (x Reason) String() string

func (Reason) Type

func (Reason) Type() protoreflect.EnumType

type RuleMatch added in v0.5.0

type RuleMatch struct {
	RuleId uint32 `protobuf:"varint,1,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"`
	// The variable: collection and key, e.g. ARGS:q or REQUEST_HEADERS:User-Agent.
	Variable string `protobuf:"bytes,2,opt,name=variable,proto3" json:"variable,omitempty"`
	// contains filtered or unexported fields
}

RuleMatch is where a rule matched.

func (*RuleMatch) Descriptor deprecated added in v0.5.0

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

Deprecated: Use RuleMatch.ProtoReflect.Descriptor instead.

func (*RuleMatch) GetRuleId added in v0.5.0

func (x *RuleMatch) GetRuleId() uint32

func (*RuleMatch) GetVariable added in v0.5.0

func (x *RuleMatch) GetVariable() string

func (*RuleMatch) ProtoMessage added in v0.5.0

func (*RuleMatch) ProtoMessage()

func (*RuleMatch) ProtoReflect added in v0.5.0

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

func (*RuleMatch) Reset added in v0.5.0

func (x *RuleMatch) Reset()

func (*RuleMatch) String added in v0.5.0

func (x *RuleMatch) String() string

type UnimplementedCheckServiceServer

type UnimplementedCheckServiceServer struct{}

UnimplementedCheckServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedCheckServiceServer) Check

type UnsafeCheckServiceServer

type UnsafeCheckServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeCheckServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CheckServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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