Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterWorktraceControllerServiceServer(s grpc.ServiceRegistrar, srv WorktraceControllerServiceServer)
- type GetRulesRequest
- func (*GetRulesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetRulesRequest) GetCurrentVersion() string
- func (x *GetRulesRequest) GetNodeName() string
- func (*GetRulesRequest) ProtoMessage()
- func (x *GetRulesRequest) ProtoReflect() protoreflect.Message
- func (x *GetRulesRequest) Reset()
- func (x *GetRulesRequest) String() string
- type GetRulesResponse
- func (*GetRulesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetRulesResponse) GetFiles() map[string][]byte
- func (x *GetRulesResponse) GetNotModified() bool
- func (x *GetRulesResponse) GetVersion() string
- func (*GetRulesResponse) ProtoMessage()
- func (x *GetRulesResponse) ProtoReflect() protoreflect.Message
- func (x *GetRulesResponse) Reset()
- func (x *GetRulesResponse) String() string
- type GetThreatsQuerySchemaRequest
- func (*GetThreatsQuerySchemaRequest) Descriptor() ([]byte, []int)deprecated
- func (*GetThreatsQuerySchemaRequest) ProtoMessage()
- func (x *GetThreatsQuerySchemaRequest) ProtoReflect() protoreflect.Message
- func (x *GetThreatsQuerySchemaRequest) Reset()
- func (x *GetThreatsQuerySchemaRequest) String() string
- type QueryThreatsRequest
- func (*QueryThreatsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryThreatsRequest) GetQuery() *v1.Payload
- func (*QueryThreatsRequest) ProtoMessage()
- func (x *QueryThreatsRequest) ProtoReflect() protoreflect.Message
- func (x *QueryThreatsRequest) Reset()
- func (x *QueryThreatsRequest) String() string
- type Threat
- func (*Threat) Descriptor() ([]byte, []int)deprecated
- func (x *Threat) GetConfidence() float64
- func (x *Threat) GetContainerName() string
- func (x *Threat) GetDescription() string
- func (x *Threat) GetDetectedAt() *timestamp.Timestamp
- func (x *Threat) GetDetectionPipeline() string
- func (x *Threat) GetEvidence() *_struct.Struct
- func (x *Threat) GetId() string
- func (x *Threat) GetMergedInto() string
- func (x *Threat) GetMode() string
- func (x *Threat) GetNamespace() string
- func (x *Threat) GetNodeName() string
- func (x *Threat) GetOccurrences() int32
- func (x *Threat) GetReceivedAt() *timestamp.Timestamp
- func (x *Threat) GetRuleId() string
- func (x *Threat) GetSeverity() string
- func (x *Threat) GetTitle() string
- func (x *Threat) GetWorkspaceId() string
- func (*Threat) ProtoMessage()
- func (x *Threat) ProtoReflect() protoreflect.Message
- func (x *Threat) Reset()
- func (x *Threat) String() string
- type ThreatList
- type UnimplementedWorktraceControllerServiceServer
- func (UnimplementedWorktraceControllerServiceServer) GetRules(context.Context, *GetRulesRequest) (*GetRulesResponse, error)
- func (UnimplementedWorktraceControllerServiceServer) GetThreatsQuerySchema(context.Context, *GetThreatsQuerySchemaRequest) (*v11.Descriptor, error)
- func (UnimplementedWorktraceControllerServiceServer) GetVersionInfo(context.Context, *v1.GetVersionInfoRequest) (*v1.GetVersionInfoResponse, error)
- func (UnimplementedWorktraceControllerServiceServer) QueryThreats(context.Context, *QueryThreatsRequest) (*ThreatList, error)
- type UnsafeWorktraceControllerServiceServer
- type WorktraceControllerServiceClient
- type WorktraceControllerServiceServer
Constants ¶
const ( WorktraceControllerService_GetVersionInfo_FullMethodName = "/worktrace.v1.WorktraceControllerService/GetVersionInfo" WorktraceControllerService_GetRules_FullMethodName = "/worktrace.v1.WorktraceControllerService/GetRules" WorktraceControllerService_GetThreatsQuerySchema_FullMethodName = "/worktrace.v1.WorktraceControllerService/GetThreatsQuerySchema" WorktraceControllerService_QueryThreats_FullMethodName = "/worktrace.v1.WorktraceControllerService/QueryThreats" )
Variables ¶
var File_worktrace_v1_worktrace_proto protoreflect.FileDescriptor
var WorktraceControllerService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "worktrace.v1.WorktraceControllerService", HandlerType: (*WorktraceControllerServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetVersionInfo", Handler: _WorktraceControllerService_GetVersionInfo_Handler, }, { MethodName: "GetRules", Handler: _WorktraceControllerService_GetRules_Handler, }, { MethodName: "GetThreatsQuerySchema", Handler: _WorktraceControllerService_GetThreatsQuerySchema_Handler, }, { MethodName: "QueryThreats", Handler: _WorktraceControllerService_QueryThreats_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "worktrace/v1/worktrace.proto", }
WorktraceControllerService_ServiceDesc is the grpc.ServiceDesc for WorktraceControllerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWorktraceControllerServiceServer ¶
func RegisterWorktraceControllerServiceServer(s grpc.ServiceRegistrar, srv WorktraceControllerServiceServer)
Types ¶
type GetRulesRequest ¶
type GetRulesRequest struct {
// current_version is the version of the rule set the caller currently runs,
// as returned by an earlier GetRules call. Empty if the caller has none.
CurrentVersion string `protobuf:"bytes,1,opt,name=current_version,json=currentVersion,proto3" json:"current_version,omitempty"`
// node_name is the Kubernetes node the detector runs on. Informational
// (logging, and a future per-node or per-scope rule selection).
NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
// contains filtered or unexported fields
}
GetRulesRequest asks for the current rule set.
func (*GetRulesRequest) Descriptor
deprecated
func (*GetRulesRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRulesRequest.ProtoReflect.Descriptor instead.
func (*GetRulesRequest) GetCurrentVersion ¶
func (x *GetRulesRequest) GetCurrentVersion() string
func (*GetRulesRequest) GetNodeName ¶
func (x *GetRulesRequest) GetNodeName() string
func (*GetRulesRequest) ProtoMessage ¶
func (*GetRulesRequest) ProtoMessage()
func (*GetRulesRequest) ProtoReflect ¶
func (x *GetRulesRequest) ProtoReflect() protoreflect.Message
func (*GetRulesRequest) Reset ¶
func (x *GetRulesRequest) Reset()
func (*GetRulesRequest) String ¶
func (x *GetRulesRequest) String() string
type GetRulesResponse ¶
type GetRulesResponse struct {
// version identifies the rule set: a content hash of all files, so equal
// content always yields an equal version across controller replicas.
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
// not_modified is true when the caller's current_version equals version. In
// that case files is empty and the caller keeps its current rules.
NotModified bool `protobuf:"varint,2,opt,name=not_modified,json=notModified,proto3" json:"not_modified,omitempty"`
// files maps a relative file name (e.g. "other-malicious/reverse_shell.yaml")
// to its YAML content. It is always a complete snapshot, never a delta.
Files map[string][]byte `` /* 137-byte string literal not displayed */
// contains filtered or unexported fields
}
GetRulesResponse carries the current rule set, or just its version.
func (*GetRulesResponse) Descriptor
deprecated
func (*GetRulesResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetRulesResponse.ProtoReflect.Descriptor instead.
func (*GetRulesResponse) GetFiles ¶
func (x *GetRulesResponse) GetFiles() map[string][]byte
func (*GetRulesResponse) GetNotModified ¶
func (x *GetRulesResponse) GetNotModified() bool
func (*GetRulesResponse) GetVersion ¶
func (x *GetRulesResponse) GetVersion() string
func (*GetRulesResponse) ProtoMessage ¶
func (*GetRulesResponse) ProtoMessage()
func (*GetRulesResponse) ProtoReflect ¶
func (x *GetRulesResponse) ProtoReflect() protoreflect.Message
func (*GetRulesResponse) Reset ¶
func (x *GetRulesResponse) Reset()
func (*GetRulesResponse) String ¶
func (x *GetRulesResponse) String() string
type GetThreatsQuerySchemaRequest ¶ added in v0.63.5
type GetThreatsQuerySchemaRequest struct {
// contains filtered or unexported fields
}
GetThreatsQuerySchemaRequest asks for the threats query descriptor.
func (*GetThreatsQuerySchemaRequest) Descriptor
deprecated
added in
v0.63.5
func (*GetThreatsQuerySchemaRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetThreatsQuerySchemaRequest.ProtoReflect.Descriptor instead.
func (*GetThreatsQuerySchemaRequest) ProtoMessage ¶ added in v0.63.5
func (*GetThreatsQuerySchemaRequest) ProtoMessage()
func (*GetThreatsQuerySchemaRequest) ProtoReflect ¶ added in v0.63.5
func (x *GetThreatsQuerySchemaRequest) ProtoReflect() protoreflect.Message
func (*GetThreatsQuerySchemaRequest) Reset ¶ added in v0.63.5
func (x *GetThreatsQuerySchemaRequest) Reset()
func (*GetThreatsQuerySchemaRequest) String ¶ added in v0.63.5
func (x *GetThreatsQuerySchemaRequest) String() string
type QueryThreatsRequest ¶ added in v0.63.5
type QueryThreatsRequest struct {
Query *v1.Payload `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
// contains filtered or unexported fields
}
QueryThreatsRequest carries a threats query.
func (*QueryThreatsRequest) Descriptor
deprecated
added in
v0.63.5
func (*QueryThreatsRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryThreatsRequest.ProtoReflect.Descriptor instead.
func (*QueryThreatsRequest) GetQuery ¶ added in v0.63.5
func (x *QueryThreatsRequest) GetQuery() *v1.Payload
func (*QueryThreatsRequest) ProtoMessage ¶ added in v0.63.5
func (*QueryThreatsRequest) ProtoMessage()
func (*QueryThreatsRequest) ProtoReflect ¶ added in v0.63.5
func (x *QueryThreatsRequest) ProtoReflect() protoreflect.Message
func (*QueryThreatsRequest) Reset ¶ added in v0.63.5
func (x *QueryThreatsRequest) Reset()
func (*QueryThreatsRequest) String ¶ added in v0.63.5
func (x *QueryThreatsRequest) String() string
type Threat ¶ added in v0.63.5
type Threat struct {
// id uniquely identifies the threat (the detector's threat ID, or a
// generated ID for a dedup summary).
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// detected_at is when the detector detected the threat.
DetectedAt *timestamp.Timestamp `protobuf:"bytes,2,opt,name=detected_at,json=detectedAt,proto3" json:"detected_at,omitempty"`
// received_at is when the controller stored the threat.
ReceivedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=received_at,json=receivedAt,proto3" json:"received_at,omitempty"`
// severity is "low", "medium", "high" or "critical", derived from
// confidence by the controller's severity levels at the time it was stored.
Severity string `protobuf:"bytes,4,opt,name=severity,proto3" json:"severity,omitempty"`
Confidence float64 `protobuf:"fixed64,5,opt,name=confidence,proto3" json:"confidence,omitempty"`
Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"`
Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"`
// detection_pipeline is "direct", "correlation" or "behavioral".
DetectionPipeline string `protobuf:"bytes,8,opt,name=detection_pipeline,json=detectionPipeline,proto3" json:"detection_pipeline,omitempty"`
// rule_id is the detection rule or attack path that fired; empty for
// behavioral anomalies.
RuleId string `protobuf:"bytes,9,opt,name=rule_id,json=ruleId,proto3" json:"rule_id,omitempty"`
Namespace string `protobuf:"bytes,10,opt,name=namespace,proto3" json:"namespace,omitempty"`
// workspace_id is empty for events without pod context.
WorkspaceId string `protobuf:"bytes,11,opt,name=workspace_id,json=workspaceId,proto3" json:"workspace_id,omitempty"`
NodeName string `protobuf:"bytes,12,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
ContainerName string `protobuf:"bytes,13,opt,name=container_name,json=containerName,proto3" json:"container_name,omitempty"`
// mode is "shadow" for a threat of a rule rolled out in shadow mode
// (recorded, never alerted on); empty otherwise.
Mode string `protobuf:"bytes,14,opt,name=mode,proto3" json:"mode,omitempty"`
// merged_into is the ID of the threat this one was merged into (same
// process, within the dedup window); empty for a reported threat.
MergedInto string `protobuf:"bytes,15,opt,name=merged_into,json=mergedInto,proto3" json:"merged_into,omitempty"`
// occurrences is set on a dedup summary: how many threats for the same
// rule and workspace its window saw.
Occurrences int32 `protobuf:"varint,16,opt,name=occurrences,proto3" json:"occurrences,omitempty"`
// evidence carries rule-specific details (process, file path, syscall
// arguments, ...).
Evidence *_struct.Struct `protobuf:"bytes,17,opt,name=evidence,proto3" json:"evidence,omitempty"`
// contains filtered or unexported fields
}
Threat is a threat reported by a detector, as stored by the controller.
func (*Threat) Descriptor
deprecated
added in
v0.63.5
func (*Threat) GetConfidence ¶ added in v0.63.5
func (*Threat) GetContainerName ¶ added in v0.63.5
func (*Threat) GetDescription ¶ added in v0.63.5
func (*Threat) GetDetectedAt ¶ added in v0.63.5
func (*Threat) GetDetectionPipeline ¶ added in v0.63.5
func (*Threat) GetEvidence ¶ added in v0.63.5
func (*Threat) GetMergedInto ¶ added in v0.63.5
func (*Threat) GetNamespace ¶ added in v0.63.5
func (*Threat) GetNodeName ¶ added in v0.63.5
func (*Threat) GetOccurrences ¶ added in v0.63.5
func (*Threat) GetReceivedAt ¶ added in v0.63.5
func (*Threat) GetSeverity ¶ added in v0.63.5
func (*Threat) GetWorkspaceId ¶ added in v0.63.5
func (*Threat) ProtoMessage ¶ added in v0.63.5
func (*Threat) ProtoMessage()
func (*Threat) ProtoReflect ¶ added in v0.63.5
func (x *Threat) ProtoReflect() protoreflect.Message
type ThreatList ¶ added in v0.63.5
type ThreatList struct {
Threats []*Threat `protobuf:"bytes,1,rep,name=threats,proto3" json:"threats,omitempty"`
// contains filtered or unexported fields
}
ThreatList is a page of stored threats.
func (*ThreatList) Descriptor
deprecated
added in
v0.63.5
func (*ThreatList) Descriptor() ([]byte, []int)
Deprecated: Use ThreatList.ProtoReflect.Descriptor instead.
func (*ThreatList) GetThreats ¶ added in v0.63.5
func (x *ThreatList) GetThreats() []*Threat
func (*ThreatList) ProtoMessage ¶ added in v0.63.5
func (*ThreatList) ProtoMessage()
func (*ThreatList) ProtoReflect ¶ added in v0.63.5
func (x *ThreatList) ProtoReflect() protoreflect.Message
func (*ThreatList) Reset ¶ added in v0.63.5
func (x *ThreatList) Reset()
func (*ThreatList) String ¶ added in v0.63.5
func (x *ThreatList) String() string
type UnimplementedWorktraceControllerServiceServer ¶
type UnimplementedWorktraceControllerServiceServer struct{}
UnimplementedWorktraceControllerServiceServer 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 (UnimplementedWorktraceControllerServiceServer) GetRules ¶
func (UnimplementedWorktraceControllerServiceServer) GetRules(context.Context, *GetRulesRequest) (*GetRulesResponse, error)
func (UnimplementedWorktraceControllerServiceServer) GetThreatsQuerySchema ¶ added in v0.63.5
func (UnimplementedWorktraceControllerServiceServer) GetThreatsQuerySchema(context.Context, *GetThreatsQuerySchemaRequest) (*v11.Descriptor, error)
func (UnimplementedWorktraceControllerServiceServer) GetVersionInfo ¶
func (UnimplementedWorktraceControllerServiceServer) GetVersionInfo(context.Context, *v1.GetVersionInfoRequest) (*v1.GetVersionInfoResponse, error)
func (UnimplementedWorktraceControllerServiceServer) QueryThreats ¶ added in v0.63.5
func (UnimplementedWorktraceControllerServiceServer) QueryThreats(context.Context, *QueryThreatsRequest) (*ThreatList, error)
type UnsafeWorktraceControllerServiceServer ¶
type UnsafeWorktraceControllerServiceServer interface {
// contains filtered or unexported methods
}
UnsafeWorktraceControllerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WorktraceControllerServiceServer will result in compilation errors.
type WorktraceControllerServiceClient ¶
type WorktraceControllerServiceClient interface {
// GetVersionInfo returns build and version metadata for the controller.
GetVersionInfo(ctx context.Context, in *v1.GetVersionInfoRequest, opts ...grpc.CallOption) (*v1.GetVersionInfoResponse, error)
// GetRules returns the current detection rule set. Detectors call it
// periodically with the version they currently run; when it still matches,
// the controller answers with not_modified and no payload.
GetRules(ctx context.Context, in *GetRulesRequest, opts ...grpc.CallOption) (*GetRulesResponse, error)
// GetThreatsQuerySchema returns the query.v1.Descriptor advertising which
// threat fields are queryable/sortable via QueryThreats, and which
// operators are valid on each.
GetThreatsQuerySchema(ctx context.Context, in *GetThreatsQuerySchemaRequest, opts ...grpc.CallOption) (*v11.Descriptor, error)
// QueryThreats retrieves stored threats matching a generic
// query.v1.Payload, as advertised by GetThreatsQuerySchema. Threats are
// stored after the controller's deduplication: reported, merged (see
// Threat.merged_into), shadow (see Threat.mode) and dedup-summary (see
// Threat.occurrences) threats. Fails with UNAVAILABLE when the controller
// runs without a threat store.
QueryThreats(ctx context.Context, in *QueryThreatsRequest, opts ...grpc.CallOption) (*ThreatList, error)
}
WorktraceControllerServiceClient is the client API for WorktraceControllerService 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.
WorktraceControllerService is the gRPC API served by the worktrace controller to its detector instances (rules) and to other k8shell services (threats).
func NewWorktraceControllerServiceClient ¶
func NewWorktraceControllerServiceClient(cc grpc.ClientConnInterface) WorktraceControllerServiceClient
type WorktraceControllerServiceServer ¶
type WorktraceControllerServiceServer interface {
// GetVersionInfo returns build and version metadata for the controller.
GetVersionInfo(context.Context, *v1.GetVersionInfoRequest) (*v1.GetVersionInfoResponse, error)
// GetRules returns the current detection rule set. Detectors call it
// periodically with the version they currently run; when it still matches,
// the controller answers with not_modified and no payload.
GetRules(context.Context, *GetRulesRequest) (*GetRulesResponse, error)
// GetThreatsQuerySchema returns the query.v1.Descriptor advertising which
// threat fields are queryable/sortable via QueryThreats, and which
// operators are valid on each.
GetThreatsQuerySchema(context.Context, *GetThreatsQuerySchemaRequest) (*v11.Descriptor, error)
// QueryThreats retrieves stored threats matching a generic
// query.v1.Payload, as advertised by GetThreatsQuerySchema. Threats are
// stored after the controller's deduplication: reported, merged (see
// Threat.merged_into), shadow (see Threat.mode) and dedup-summary (see
// Threat.occurrences) threats. Fails with UNAVAILABLE when the controller
// runs without a threat store.
QueryThreats(context.Context, *QueryThreatsRequest) (*ThreatList, error)
// contains filtered or unexported methods
}
WorktraceControllerServiceServer is the server API for WorktraceControllerService service. All implementations must embed UnimplementedWorktraceControllerServiceServer for forward compatibility.
WorktraceControllerService is the gRPC API served by the worktrace controller to its detector instances (rules) and to other k8shell services (threats).