Documentation
¶
Index ¶
- Constants
- Variables
- func DeleteAgent(cnf *config.Config) error
- func GetAgentManagerConnection(cnf *config.Config) (*grpc.ClientConn, error)
- func GetCorrelationConnection(cnf *config.Config) (*grpc.ClientConn, error)
- func GetDataRetention() (int, error)
- func IncidentResponseStream(cnf *config.Config, ctx context.Context)
- func LogConnectionError(err error, target string, errorLogged *bool)
- func LogStreamError(err error, streamName string, errorLogged *bool)
- func RegisterAgent(cnf *config.Config, UTMKey string) error
- func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer)
- func RegisterPanelServiceServer(s grpc.ServiceRegistrar, srv PanelServiceServer)
- func RegisterPingServiceServer(s grpc.ServiceRegistrar, srv PingServiceServer)
- func SetDataRetention(retention string) error
- func StartPing(cnf *config.Config, ctx context.Context)
- func UninstallAll() error
- func UpdateAgent(cnf *config.Config, ctx context.Context)
- type Agent
- func (*Agent) Descriptor() ([]byte, []int)deprecated
- func (x *Agent) GetAddresses() string
- func (x *Agent) GetAgentKey() string
- func (x *Agent) GetAliases() string
- func (x *Agent) GetHostname() string
- func (x *Agent) GetId() uint32
- func (x *Agent) GetIp() string
- func (x *Agent) GetLastSeen() string
- func (x *Agent) GetMac() string
- func (x *Agent) GetOs() string
- func (x *Agent) GetOsMajorVersion() string
- func (x *Agent) GetOsMinorVersion() string
- func (x *Agent) GetPlatform() string
- func (x *Agent) GetStatus() Status
- func (x *Agent) GetVersion() string
- func (*Agent) ProtoMessage()
- func (x *Agent) ProtoReflect() protoreflect.Message
- func (x *Agent) Reset()
- func (x *Agent) String() string
- type AgentCommand
- func (*AgentCommand) Descriptor() ([]byte, []int)deprecated
- func (x *AgentCommand) GetAgentId() uint32
- func (x *AgentCommand) GetCmdId() string
- func (x *AgentCommand) GetCommand() string
- func (x *AgentCommand) GetCommandStatus() AgentCommandStatus
- func (x *AgentCommand) GetCreatedAt() *timestamppb.Timestamp
- func (x *AgentCommand) GetExecutedBy() string
- func (x *AgentCommand) GetOriginId() string
- func (x *AgentCommand) GetOriginType() string
- func (x *AgentCommand) GetReason() string
- func (x *AgentCommand) GetResult() string
- func (x *AgentCommand) GetUpdatedAt() *timestamppb.Timestamp
- func (*AgentCommand) ProtoMessage()
- func (x *AgentCommand) ProtoReflect() protoreflect.Message
- func (x *AgentCommand) Reset()
- func (x *AgentCommand) String() string
- type AgentCommandStatus
- func (AgentCommandStatus) Descriptor() protoreflect.EnumDescriptor
- func (x AgentCommandStatus) Enum() *AgentCommandStatus
- func (AgentCommandStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x AgentCommandStatus) Number() protoreflect.EnumNumber
- func (x AgentCommandStatus) String() string
- func (AgentCommandStatus) Type() protoreflect.EnumType
- type AgentRequest
- func (*AgentRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AgentRequest) GetAddresses() string
- func (x *AgentRequest) GetAliases() string
- func (x *AgentRequest) GetHostname() string
- func (x *AgentRequest) GetIp() string
- func (x *AgentRequest) GetMac() string
- func (x *AgentRequest) GetOs() string
- func (x *AgentRequest) GetOsMajorVersion() string
- func (x *AgentRequest) GetOsMinorVersion() string
- func (x *AgentRequest) GetPlatform() string
- func (x *AgentRequest) GetRegisterBy() string
- func (x *AgentRequest) GetVersion() string
- func (*AgentRequest) ProtoMessage()
- func (x *AgentRequest) ProtoReflect() protoreflect.Message
- func (x *AgentRequest) Reset()
- func (x *AgentRequest) String() string
- type AgentServiceClient
- type AgentServiceServer
- type AgentService_AgentStreamClient
- type AgentService_AgentStreamServer
- type AuthResponse
- func (*AuthResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AuthResponse) GetId() uint32
- func (x *AuthResponse) GetKey() string
- func (*AuthResponse) ProtoMessage()
- func (x *AuthResponse) ProtoReflect() protoreflect.Message
- func (x *AuthResponse) Reset()
- func (x *AuthResponse) String() string
- type BidirectionalStream
- func (*BidirectionalStream) Descriptor() ([]byte, []int)deprecated
- func (x *BidirectionalStream) GetCommand() *UtmCommand
- func (x *BidirectionalStream) GetResult() *CommandResult
- func (x *BidirectionalStream) GetStreamMessage() isBidirectionalStream_StreamMessage
- func (*BidirectionalStream) ProtoMessage()
- func (x *BidirectionalStream) ProtoReflect() protoreflect.Message
- func (x *BidirectionalStream) Reset()
- func (x *BidirectionalStream) String() string
- type BidirectionalStream_Command
- type BidirectionalStream_Result
- type CommandResult
- func (*CommandResult) Descriptor() ([]byte, []int)deprecated
- func (x *CommandResult) GetAgentId() string
- func (x *CommandResult) GetCmdId() string
- func (x *CommandResult) GetExecutedAt() *timestamppb.Timestamp
- func (x *CommandResult) GetResult() string
- func (*CommandResult) ProtoMessage()
- func (x *CommandResult) ProtoReflect() protoreflect.Message
- func (x *CommandResult) Reset()
- func (x *CommandResult) String() string
- type ConnectorType
- func (ConnectorType) Descriptor() protoreflect.EnumDescriptor
- func (x ConnectorType) Enum() *ConnectorType
- func (ConnectorType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ConnectorType) Number() protoreflect.EnumNumber
- func (x ConnectorType) String() string
- func (ConnectorType) Type() protoreflect.EnumType
- type DeleteRequest
- type ListAgentsCommandsResponse
- func (*ListAgentsCommandsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListAgentsCommandsResponse) GetRows() []*AgentCommand
- func (x *ListAgentsCommandsResponse) GetTotal() int32
- func (*ListAgentsCommandsResponse) ProtoMessage()
- func (x *ListAgentsCommandsResponse) ProtoReflect() protoreflect.Message
- func (x *ListAgentsCommandsResponse) Reset()
- func (x *ListAgentsCommandsResponse) String() string
- type ListAgentsResponse
- func (*ListAgentsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListAgentsResponse) GetRows() []*Agent
- func (x *ListAgentsResponse) GetTotal() int32
- func (*ListAgentsResponse) ProtoMessage()
- func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message
- func (x *ListAgentsResponse) Reset()
- func (x *ListAgentsResponse) String() string
- type ListRequest
- func (*ListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListRequest) GetPageNumber() int32
- func (x *ListRequest) GetPageSize() int32
- func (x *ListRequest) GetSearchQuery() string
- func (x *ListRequest) GetSortBy() string
- func (*ListRequest) ProtoMessage()
- func (x *ListRequest) ProtoReflect() protoreflect.Message
- func (x *ListRequest) Reset()
- func (x *ListRequest) String() string
- type LogProcessor
- type PanelServiceClient
- type PanelServiceServer
- type PanelService_ProcessCommandClient
- type PanelService_ProcessCommandServer
- type PingRequest
- type PingResponse
- type PingServiceClient
- type PingServiceServer
- type PingService_PingClient
- type PingService_PingServer
- type Status
- type StreamAction
- type UnimplementedAgentServiceServer
- func (UnimplementedAgentServiceServer) AgentStream(grpc.BidiStreamingServer[BidirectionalStream, BidirectionalStream]) error
- func (UnimplementedAgentServiceServer) DeleteAgent(context.Context, *DeleteRequest) (*AuthResponse, error)
- func (UnimplementedAgentServiceServer) ListAgentCommands(context.Context, *ListRequest) (*ListAgentsCommandsResponse, error)
- func (UnimplementedAgentServiceServer) ListAgents(context.Context, *ListRequest) (*ListAgentsResponse, error)
- func (UnimplementedAgentServiceServer) RegisterAgent(context.Context, *AgentRequest) (*AuthResponse, error)
- func (UnimplementedAgentServiceServer) UpdateAgent(context.Context, *AgentRequest) (*AuthResponse, error)
- type UnimplementedPanelServiceServer
- type UnimplementedPingServiceServer
- type UnsafeAgentServiceServer
- type UnsafePanelServiceServer
- type UnsafePingServiceServer
- type UtmCommand
- func (*UtmCommand) Descriptor() ([]byte, []int)deprecated
- func (x *UtmCommand) GetAgentId() string
- func (x *UtmCommand) GetCmdId() string
- func (x *UtmCommand) GetCommand() string
- func (x *UtmCommand) GetExecutedBy() string
- func (x *UtmCommand) GetOriginId() string
- func (x *UtmCommand) GetOriginType() string
- func (x *UtmCommand) GetReason() string
- func (x *UtmCommand) GetShell() string
- func (*UtmCommand) ProtoMessage()
- func (x *UtmCommand) ProtoReflect() protoreflect.Message
- func (x *UtmCommand) Reset()
- func (x *UtmCommand) String() string
Constants ¶
const ( AgentService_RegisterAgent_FullMethodName = "/agent.AgentService/RegisterAgent" AgentService_UpdateAgent_FullMethodName = "/agent.AgentService/UpdateAgent" AgentService_DeleteAgent_FullMethodName = "/agent.AgentService/DeleteAgent" AgentService_ListAgents_FullMethodName = "/agent.AgentService/ListAgents" AgentService_AgentStream_FullMethodName = "/agent.AgentService/AgentStream" AgentService_ListAgentCommands_FullMethodName = "/agent.AgentService/ListAgentCommands" )
const (
PanelService_ProcessCommand_FullMethodName = "/agent.PanelService/ProcessCommand"
)
const (
PingService_Ping_FullMethodName = "/agent.PingService/Ping"
)
Variables ¶
var ( AgentCommandStatus_name = map[int32]string{ 0: "NOT_EXECUTED", 1: "QUEUE", 2: "PENDING", 3: "EXECUTED", 4: "ERROR", } AgentCommandStatus_value = map[string]int32{ "NOT_EXECUTED": 0, "QUEUE": 1, "PENDING": 2, "EXECUTED": 3, "ERROR": 4, } )
Enum value maps for AgentCommandStatus.
var ( Status_name = map[int32]string{ 0: "ONLINE", 1: "OFFLINE", 2: "UNKNOWN", } Status_value = map[string]int32{ "ONLINE": 0, "OFFLINE": 1, "UNKNOWN": 2, } )
Enum value maps for Status.
var ( ConnectorType_name = map[int32]string{ 0: "AGENT", 1: "COLLECTOR", } ConnectorType_value = map[string]int32{ "AGENT": 0, "COLLECTOR": 1, } )
Enum value maps for ConnectorType.
var ( LogQueue = make(chan *plugins.Log, 10000) // ErrAgentUninstalled is returned when the agent uninstalls itself due to invalid key ErrAgentUninstalled = errors.New("agent uninstalled due to invalid key") )
var AgentService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "agent.AgentService", HandlerType: (*AgentServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RegisterAgent", Handler: _AgentService_RegisterAgent_Handler, }, { MethodName: "UpdateAgent", Handler: _AgentService_UpdateAgent_Handler, }, { MethodName: "DeleteAgent", Handler: _AgentService_DeleteAgent_Handler, }, { MethodName: "ListAgents", Handler: _AgentService_ListAgents_Handler, }, { MethodName: "ListAgentCommands", Handler: _AgentService_ListAgentCommands_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "AgentStream", Handler: _AgentService_AgentStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "agent.proto", }
AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_agent_proto protoreflect.FileDescriptor
var File_common_proto protoreflect.FileDescriptor
var File_ping_proto protoreflect.FileDescriptor
var PanelService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "agent.PanelService", HandlerType: (*PanelServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "ProcessCommand", Handler: _PanelService_ProcessCommand_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "agent.proto", }
PanelService_ServiceDesc is the grpc.ServiceDesc for PanelService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var PingService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "agent.PingService", HandlerType: (*PingServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Ping", Handler: _PingService_Ping_Handler, ClientStreams: true, }, }, Metadata: "ping.proto", }
PingService_ServiceDesc is the grpc.ServiceDesc for PingService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func DeleteAgent ¶
func GetAgentManagerConnection ¶
func GetAgentManagerConnection(cnf *config.Config) (*grpc.ClientConn, error)
func GetCorrelationConnection ¶
func GetCorrelationConnection(cnf *config.Config) (*grpc.ClientConn, error)
func GetDataRetention ¶
func LogConnectionError ¶
LogConnectionError logs a connection error with deduplication.
func LogStreamError ¶
LogStreamError logs a stream creation error with deduplication.
func RegisterAgentServiceServer ¶
func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer)
func RegisterPanelServiceServer ¶
func RegisterPanelServiceServer(s grpc.ServiceRegistrar, srv PanelServiceServer)
func RegisterPingServiceServer ¶
func RegisterPingServiceServer(s grpc.ServiceRegistrar, srv PingServiceServer)
func SetDataRetention ¶
func UninstallAll ¶
func UninstallAll() error
Types ¶
type Agent ¶
type Agent struct {
Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
Os string `protobuf:"bytes,3,opt,name=os,proto3" json:"os,omitempty"`
Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=agent.Status" json:"status,omitempty"`
Platform string `protobuf:"bytes,5,opt,name=platform,proto3" json:"platform,omitempty"`
Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
AgentKey string `protobuf:"bytes,7,opt,name=agent_key,json=agentKey,proto3" json:"agent_key,omitempty"`
Id uint32 `protobuf:"varint,8,opt,name=id,proto3" json:"id,omitempty"`
LastSeen string `protobuf:"bytes,9,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"`
Mac string `protobuf:"bytes,10,opt,name=mac,proto3" json:"mac,omitempty"`
OsMajorVersion string `protobuf:"bytes,11,opt,name=os_major_version,json=osMajorVersion,proto3" json:"os_major_version,omitempty"`
OsMinorVersion string `protobuf:"bytes,12,opt,name=os_minor_version,json=osMinorVersion,proto3" json:"os_minor_version,omitempty"`
Aliases string `protobuf:"bytes,13,opt,name=aliases,proto3" json:"aliases,omitempty"`
Addresses string `protobuf:"bytes,14,opt,name=addresses,proto3" json:"addresses,omitempty"`
// contains filtered or unexported fields
}
func (*Agent) Descriptor
deprecated
func (*Agent) GetAddresses ¶
func (*Agent) GetAgentKey ¶
func (*Agent) GetAliases ¶
func (*Agent) GetHostname ¶
func (*Agent) GetLastSeen ¶
func (*Agent) GetOsMajorVersion ¶
func (*Agent) GetOsMinorVersion ¶
func (*Agent) GetPlatform ¶
func (*Agent) GetVersion ¶
func (*Agent) ProtoMessage ¶
func (*Agent) ProtoMessage()
func (*Agent) ProtoReflect ¶
func (x *Agent) ProtoReflect() protoreflect.Message
type AgentCommand ¶
type AgentCommand struct {
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
AgentId uint32 `protobuf:"varint,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
Command string `protobuf:"bytes,4,opt,name=command,proto3" json:"command,omitempty"`
CommandStatus AgentCommandStatus `` /* 131-byte string literal not displayed */
Result string `protobuf:"bytes,6,opt,name=result,proto3" json:"result,omitempty"`
ExecutedBy string `protobuf:"bytes,7,opt,name=executed_by,json=executedBy,proto3" json:"executed_by,omitempty"`
CmdId string `protobuf:"bytes,8,opt,name=cmd_id,json=cmdId,proto3" json:"cmd_id,omitempty"`
Reason string `protobuf:"bytes,9,opt,name=reason,proto3" json:"reason,omitempty"`
OriginType string `protobuf:"bytes,10,opt,name=origin_type,json=originType,proto3" json:"origin_type,omitempty"`
OriginId string `protobuf:"bytes,11,opt,name=origin_id,json=originId,proto3" json:"origin_id,omitempty"`
// contains filtered or unexported fields
}
func (*AgentCommand) Descriptor
deprecated
func (*AgentCommand) Descriptor() ([]byte, []int)
Deprecated: Use AgentCommand.ProtoReflect.Descriptor instead.
func (*AgentCommand) GetAgentId ¶
func (x *AgentCommand) GetAgentId() uint32
func (*AgentCommand) GetCmdId ¶
func (x *AgentCommand) GetCmdId() string
func (*AgentCommand) GetCommand ¶
func (x *AgentCommand) GetCommand() string
func (*AgentCommand) GetCommandStatus ¶
func (x *AgentCommand) GetCommandStatus() AgentCommandStatus
func (*AgentCommand) GetCreatedAt ¶
func (x *AgentCommand) GetCreatedAt() *timestamppb.Timestamp
func (*AgentCommand) GetExecutedBy ¶
func (x *AgentCommand) GetExecutedBy() string
func (*AgentCommand) GetOriginId ¶
func (x *AgentCommand) GetOriginId() string
func (*AgentCommand) GetOriginType ¶
func (x *AgentCommand) GetOriginType() string
func (*AgentCommand) GetReason ¶
func (x *AgentCommand) GetReason() string
func (*AgentCommand) GetResult ¶
func (x *AgentCommand) GetResult() string
func (*AgentCommand) GetUpdatedAt ¶
func (x *AgentCommand) GetUpdatedAt() *timestamppb.Timestamp
func (*AgentCommand) ProtoMessage ¶
func (*AgentCommand) ProtoMessage()
func (*AgentCommand) ProtoReflect ¶
func (x *AgentCommand) ProtoReflect() protoreflect.Message
func (*AgentCommand) Reset ¶
func (x *AgentCommand) Reset()
func (*AgentCommand) String ¶
func (x *AgentCommand) String() string
type AgentCommandStatus ¶
type AgentCommandStatus int32
const ( AgentCommandStatus_NOT_EXECUTED AgentCommandStatus = 0 AgentCommandStatus_QUEUE AgentCommandStatus = 1 AgentCommandStatus_PENDING AgentCommandStatus = 2 AgentCommandStatus_EXECUTED AgentCommandStatus = 3 AgentCommandStatus_ERROR AgentCommandStatus = 4 )
func (AgentCommandStatus) Descriptor ¶
func (AgentCommandStatus) Descriptor() protoreflect.EnumDescriptor
func (AgentCommandStatus) Enum ¶
func (x AgentCommandStatus) Enum() *AgentCommandStatus
func (AgentCommandStatus) EnumDescriptor
deprecated
func (AgentCommandStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use AgentCommandStatus.Descriptor instead.
func (AgentCommandStatus) Number ¶
func (x AgentCommandStatus) Number() protoreflect.EnumNumber
func (AgentCommandStatus) String ¶
func (x AgentCommandStatus) String() string
func (AgentCommandStatus) Type ¶
func (AgentCommandStatus) Type() protoreflect.EnumType
type AgentRequest ¶
type AgentRequest struct {
Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
Os string `protobuf:"bytes,3,opt,name=os,proto3" json:"os,omitempty"`
Platform string `protobuf:"bytes,4,opt,name=platform,proto3" json:"platform,omitempty"`
Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
RegisterBy string `protobuf:"bytes,6,opt,name=register_by,json=registerBy,proto3" json:"register_by,omitempty"`
Mac string `protobuf:"bytes,7,opt,name=mac,proto3" json:"mac,omitempty"`
OsMajorVersion string `protobuf:"bytes,8,opt,name=os_major_version,json=osMajorVersion,proto3" json:"os_major_version,omitempty"`
OsMinorVersion string `protobuf:"bytes,9,opt,name=os_minor_version,json=osMinorVersion,proto3" json:"os_minor_version,omitempty"`
Aliases string `protobuf:"bytes,10,opt,name=aliases,proto3" json:"aliases,omitempty"`
Addresses string `protobuf:"bytes,11,opt,name=addresses,proto3" json:"addresses,omitempty"`
// contains filtered or unexported fields
}
func (*AgentRequest) Descriptor
deprecated
func (*AgentRequest) Descriptor() ([]byte, []int)
Deprecated: Use AgentRequest.ProtoReflect.Descriptor instead.
func (*AgentRequest) GetAddresses ¶
func (x *AgentRequest) GetAddresses() string
func (*AgentRequest) GetAliases ¶
func (x *AgentRequest) GetAliases() string
func (*AgentRequest) GetHostname ¶
func (x *AgentRequest) GetHostname() string
func (*AgentRequest) GetIp ¶
func (x *AgentRequest) GetIp() string
func (*AgentRequest) GetMac ¶
func (x *AgentRequest) GetMac() string
func (*AgentRequest) GetOs ¶
func (x *AgentRequest) GetOs() string
func (*AgentRequest) GetOsMajorVersion ¶
func (x *AgentRequest) GetOsMajorVersion() string
func (*AgentRequest) GetOsMinorVersion ¶
func (x *AgentRequest) GetOsMinorVersion() string
func (*AgentRequest) GetPlatform ¶
func (x *AgentRequest) GetPlatform() string
func (*AgentRequest) GetRegisterBy ¶
func (x *AgentRequest) GetRegisterBy() string
func (*AgentRequest) GetVersion ¶
func (x *AgentRequest) GetVersion() string
func (*AgentRequest) ProtoMessage ¶
func (*AgentRequest) ProtoMessage()
func (*AgentRequest) ProtoReflect ¶
func (x *AgentRequest) ProtoReflect() protoreflect.Message
func (*AgentRequest) Reset ¶
func (x *AgentRequest) Reset()
func (*AgentRequest) String ¶
func (x *AgentRequest) String() string
type AgentServiceClient ¶
type AgentServiceClient interface {
RegisterAgent(ctx context.Context, in *AgentRequest, opts ...grpc.CallOption) (*AuthResponse, error)
UpdateAgent(ctx context.Context, in *AgentRequest, opts ...grpc.CallOption) (*AuthResponse, error)
DeleteAgent(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*AuthResponse, error)
ListAgents(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListAgentsResponse, error)
AgentStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[BidirectionalStream, BidirectionalStream], error)
ListAgentCommands(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListAgentsCommandsResponse, error)
}
AgentServiceClient is the client API for AgentService 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.
func NewAgentServiceClient ¶
func NewAgentServiceClient(cc grpc.ClientConnInterface) AgentServiceClient
type AgentServiceServer ¶
type AgentServiceServer interface {
RegisterAgent(context.Context, *AgentRequest) (*AuthResponse, error)
UpdateAgent(context.Context, *AgentRequest) (*AuthResponse, error)
DeleteAgent(context.Context, *DeleteRequest) (*AuthResponse, error)
ListAgents(context.Context, *ListRequest) (*ListAgentsResponse, error)
AgentStream(grpc.BidiStreamingServer[BidirectionalStream, BidirectionalStream]) error
ListAgentCommands(context.Context, *ListRequest) (*ListAgentsCommandsResponse, error)
// contains filtered or unexported methods
}
AgentServiceServer is the server API for AgentService service. All implementations must embed UnimplementedAgentServiceServer for forward compatibility.
type AgentService_AgentStreamClient ¶
type AgentService_AgentStreamClient = grpc.BidiStreamingClient[BidirectionalStream, BidirectionalStream]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AgentService_AgentStreamServer ¶
type AgentService_AgentStreamServer = grpc.BidiStreamingServer[BidirectionalStream, BidirectionalStream]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type AuthResponse ¶
type AuthResponse struct {
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
func (*AuthResponse) Descriptor
deprecated
func (*AuthResponse) Descriptor() ([]byte, []int)
Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead.
func (*AuthResponse) GetId ¶
func (x *AuthResponse) GetId() uint32
func (*AuthResponse) GetKey ¶
func (x *AuthResponse) GetKey() string
func (*AuthResponse) ProtoMessage ¶
func (*AuthResponse) ProtoMessage()
func (*AuthResponse) ProtoReflect ¶
func (x *AuthResponse) ProtoReflect() protoreflect.Message
func (*AuthResponse) Reset ¶
func (x *AuthResponse) Reset()
func (*AuthResponse) String ¶
func (x *AuthResponse) String() string
type BidirectionalStream ¶
type BidirectionalStream struct {
// Types that are valid to be assigned to StreamMessage:
//
// *BidirectionalStream_Command
// *BidirectionalStream_Result
StreamMessage isBidirectionalStream_StreamMessage `protobuf_oneof:"stream_message"`
// contains filtered or unexported fields
}
func (*BidirectionalStream) Descriptor
deprecated
func (*BidirectionalStream) Descriptor() ([]byte, []int)
Deprecated: Use BidirectionalStream.ProtoReflect.Descriptor instead.
func (*BidirectionalStream) GetCommand ¶
func (x *BidirectionalStream) GetCommand() *UtmCommand
func (*BidirectionalStream) GetResult ¶
func (x *BidirectionalStream) GetResult() *CommandResult
func (*BidirectionalStream) GetStreamMessage ¶
func (x *BidirectionalStream) GetStreamMessage() isBidirectionalStream_StreamMessage
func (*BidirectionalStream) ProtoMessage ¶
func (*BidirectionalStream) ProtoMessage()
func (*BidirectionalStream) ProtoReflect ¶
func (x *BidirectionalStream) ProtoReflect() protoreflect.Message
func (*BidirectionalStream) Reset ¶
func (x *BidirectionalStream) Reset()
func (*BidirectionalStream) String ¶
func (x *BidirectionalStream) String() string
type BidirectionalStream_Command ¶
type BidirectionalStream_Command struct {
Command *UtmCommand `protobuf:"bytes,1,opt,name=command,proto3,oneof"`
}
type BidirectionalStream_Result ¶
type BidirectionalStream_Result struct {
Result *CommandResult `protobuf:"bytes,2,opt,name=result,proto3,oneof"`
}
type CommandResult ¶
type CommandResult struct {
AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
Result string `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
ExecutedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"`
CmdId string `protobuf:"bytes,4,opt,name=cmd_id,json=cmdId,proto3" json:"cmd_id,omitempty"`
// contains filtered or unexported fields
}
func (*CommandResult) Descriptor
deprecated
func (*CommandResult) Descriptor() ([]byte, []int)
Deprecated: Use CommandResult.ProtoReflect.Descriptor instead.
func (*CommandResult) GetAgentId ¶
func (x *CommandResult) GetAgentId() string
func (*CommandResult) GetCmdId ¶
func (x *CommandResult) GetCmdId() string
func (*CommandResult) GetExecutedAt ¶
func (x *CommandResult) GetExecutedAt() *timestamppb.Timestamp
func (*CommandResult) GetResult ¶
func (x *CommandResult) GetResult() string
func (*CommandResult) ProtoMessage ¶
func (*CommandResult) ProtoMessage()
func (*CommandResult) ProtoReflect ¶
func (x *CommandResult) ProtoReflect() protoreflect.Message
func (*CommandResult) Reset ¶
func (x *CommandResult) Reset()
func (*CommandResult) String ¶
func (x *CommandResult) String() string
type ConnectorType ¶
type ConnectorType int32
const ( ConnectorType_AGENT ConnectorType = 0 ConnectorType_COLLECTOR ConnectorType = 1 )
func (ConnectorType) Descriptor ¶
func (ConnectorType) Descriptor() protoreflect.EnumDescriptor
func (ConnectorType) Enum ¶
func (x ConnectorType) Enum() *ConnectorType
func (ConnectorType) EnumDescriptor
deprecated
func (ConnectorType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ConnectorType.Descriptor instead.
func (ConnectorType) Number ¶
func (x ConnectorType) Number() protoreflect.EnumNumber
func (ConnectorType) String ¶
func (x ConnectorType) String() string
func (ConnectorType) Type ¶
func (ConnectorType) Type() protoreflect.EnumType
type DeleteRequest ¶
type DeleteRequest struct {
DeletedBy string `protobuf:"bytes,1,opt,name=deleted_by,json=deletedBy,proto3" json:"deleted_by,omitempty"`
// contains filtered or unexported fields
}
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetDeletedBy ¶
func (x *DeleteRequest) GetDeletedBy() string
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type ListAgentsCommandsResponse ¶
type ListAgentsCommandsResponse struct {
Rows []*AgentCommand `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
// contains filtered or unexported fields
}
func (*ListAgentsCommandsResponse) Descriptor
deprecated
func (*ListAgentsCommandsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListAgentsCommandsResponse.ProtoReflect.Descriptor instead.
func (*ListAgentsCommandsResponse) GetRows ¶
func (x *ListAgentsCommandsResponse) GetRows() []*AgentCommand
func (*ListAgentsCommandsResponse) GetTotal ¶
func (x *ListAgentsCommandsResponse) GetTotal() int32
func (*ListAgentsCommandsResponse) ProtoMessage ¶
func (*ListAgentsCommandsResponse) ProtoMessage()
func (*ListAgentsCommandsResponse) ProtoReflect ¶
func (x *ListAgentsCommandsResponse) ProtoReflect() protoreflect.Message
func (*ListAgentsCommandsResponse) Reset ¶
func (x *ListAgentsCommandsResponse) Reset()
func (*ListAgentsCommandsResponse) String ¶
func (x *ListAgentsCommandsResponse) String() string
type ListAgentsResponse ¶
type ListAgentsResponse struct {
Rows []*Agent `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows,omitempty"`
Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
// contains filtered or unexported fields
}
func (*ListAgentsResponse) Descriptor
deprecated
func (*ListAgentsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListAgentsResponse.ProtoReflect.Descriptor instead.
func (*ListAgentsResponse) GetRows ¶
func (x *ListAgentsResponse) GetRows() []*Agent
func (*ListAgentsResponse) GetTotal ¶
func (x *ListAgentsResponse) GetTotal() int32
func (*ListAgentsResponse) ProtoMessage ¶
func (*ListAgentsResponse) ProtoMessage()
func (*ListAgentsResponse) ProtoReflect ¶
func (x *ListAgentsResponse) ProtoReflect() protoreflect.Message
func (*ListAgentsResponse) Reset ¶
func (x *ListAgentsResponse) Reset()
func (*ListAgentsResponse) String ¶
func (x *ListAgentsResponse) String() string
type ListRequest ¶
type ListRequest struct {
PageNumber int32 `protobuf:"varint,1,opt,name=page_number,json=pageNumber,proto3" json:"page_number,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
SearchQuery string `protobuf:"bytes,3,opt,name=search_query,json=searchQuery,proto3" json:"search_query,omitempty"`
SortBy string `protobuf:"bytes,4,opt,name=sort_by,json=sortBy,proto3" json:"sort_by,omitempty"`
// contains filtered or unexported fields
}
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetPageNumber ¶
func (x *ListRequest) GetPageNumber() int32
func (*ListRequest) GetPageSize ¶
func (x *ListRequest) GetPageSize() int32
func (*ListRequest) GetSearchQuery ¶
func (x *ListRequest) GetSearchQuery() string
func (*ListRequest) GetSortBy ¶
func (x *ListRequest) GetSortBy() string
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type LogProcessor ¶
type LogProcessor struct {
// contains filtered or unexported fields
}
func GetLogProcessor ¶
func GetLogProcessor() (*LogProcessor, error)
func (*LogProcessor) CleanCountedLogs ¶
func (l *LogProcessor) CleanCountedLogs()
func (*LogProcessor) ProcessLogs ¶
func (l *LogProcessor) ProcessLogs(cnf *config.Config, ctx context.Context)
type PanelServiceClient ¶
type PanelServiceClient interface {
ProcessCommand(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[UtmCommand, CommandResult], error)
}
PanelServiceClient is the client API for PanelService 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.
func NewPanelServiceClient ¶
func NewPanelServiceClient(cc grpc.ClientConnInterface) PanelServiceClient
type PanelServiceServer ¶
type PanelServiceServer interface {
ProcessCommand(grpc.BidiStreamingServer[UtmCommand, CommandResult]) error
// contains filtered or unexported methods
}
PanelServiceServer is the server API for PanelService service. All implementations must embed UnimplementedPanelServiceServer for forward compatibility.
type PanelService_ProcessCommandClient ¶
type PanelService_ProcessCommandClient = grpc.BidiStreamingClient[UtmCommand, CommandResult]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type PanelService_ProcessCommandServer ¶
type PanelService_ProcessCommandServer = grpc.BidiStreamingServer[UtmCommand, CommandResult]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type PingRequest ¶
type PingRequest struct {
Type ConnectorType `protobuf:"varint,1,opt,name=type,proto3,enum=agent.ConnectorType" json:"type,omitempty"`
// contains filtered or unexported fields
}
func (*PingRequest) Descriptor
deprecated
func (*PingRequest) Descriptor() ([]byte, []int)
Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.
func (*PingRequest) GetType ¶
func (x *PingRequest) GetType() ConnectorType
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) ProtoReflect ¶
func (x *PingRequest) ProtoReflect() protoreflect.Message
func (*PingRequest) Reset ¶
func (x *PingRequest) Reset()
func (*PingRequest) String ¶
func (x *PingRequest) String() string
type PingResponse ¶
type PingResponse struct {
Received string `protobuf:"bytes,1,opt,name=received,proto3" json:"received,omitempty"`
// contains filtered or unexported fields
}
func (*PingResponse) Descriptor
deprecated
func (*PingResponse) Descriptor() ([]byte, []int)
Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.
func (*PingResponse) GetReceived ¶
func (x *PingResponse) GetReceived() string
func (*PingResponse) ProtoMessage ¶
func (*PingResponse) ProtoMessage()
func (*PingResponse) ProtoReflect ¶
func (x *PingResponse) ProtoReflect() protoreflect.Message
func (*PingResponse) Reset ¶
func (x *PingResponse) Reset()
func (*PingResponse) String ¶
func (x *PingResponse) String() string
type PingServiceClient ¶
type PingServiceClient interface {
Ping(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[PingRequest, PingResponse], error)
}
PingServiceClient is the client API for PingService 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.
func NewPingServiceClient ¶
func NewPingServiceClient(cc grpc.ClientConnInterface) PingServiceClient
type PingServiceServer ¶
type PingServiceServer interface {
Ping(grpc.ClientStreamingServer[PingRequest, PingResponse]) error
// contains filtered or unexported methods
}
PingServiceServer is the server API for PingService service. All implementations must embed UnimplementedPingServiceServer for forward compatibility.
type PingService_PingClient ¶
type PingService_PingClient = grpc.ClientStreamingClient[PingRequest, PingResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type PingService_PingServer ¶
type PingService_PingServer = grpc.ClientStreamingServer[PingRequest, PingResponse]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type StreamAction ¶
type StreamAction int
StreamAction indicates what the caller should do after handling a gRPC error.
const ( // ActionContinue means retry the operation (non-fatal error). ActionContinue StreamAction = iota // ActionReconnect means break the inner loop and reconnect the stream. ActionReconnect )
func HandleGRPCStreamError ¶
func HandleGRPCStreamError(err error, msg string, errorLogged *bool) StreamAction
HandleGRPCStreamError processes a gRPC stream error and returns the appropriate action. It handles EOF, Unavailable, and Canceled errors with deduplication of log messages. The errorLogged pointer tracks whether an error has already been logged to avoid spam.
type UnimplementedAgentServiceServer ¶
type UnimplementedAgentServiceServer struct{}
UnimplementedAgentServiceServer 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 (UnimplementedAgentServiceServer) AgentStream ¶
func (UnimplementedAgentServiceServer) AgentStream(grpc.BidiStreamingServer[BidirectionalStream, BidirectionalStream]) error
func (UnimplementedAgentServiceServer) DeleteAgent ¶
func (UnimplementedAgentServiceServer) DeleteAgent(context.Context, *DeleteRequest) (*AuthResponse, error)
func (UnimplementedAgentServiceServer) ListAgentCommands ¶
func (UnimplementedAgentServiceServer) ListAgentCommands(context.Context, *ListRequest) (*ListAgentsCommandsResponse, error)
func (UnimplementedAgentServiceServer) ListAgents ¶
func (UnimplementedAgentServiceServer) ListAgents(context.Context, *ListRequest) (*ListAgentsResponse, error)
func (UnimplementedAgentServiceServer) RegisterAgent ¶
func (UnimplementedAgentServiceServer) RegisterAgent(context.Context, *AgentRequest) (*AuthResponse, error)
func (UnimplementedAgentServiceServer) UpdateAgent ¶
func (UnimplementedAgentServiceServer) UpdateAgent(context.Context, *AgentRequest) (*AuthResponse, error)
type UnimplementedPanelServiceServer ¶
type UnimplementedPanelServiceServer struct{}
UnimplementedPanelServiceServer 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 (UnimplementedPanelServiceServer) ProcessCommand ¶
func (UnimplementedPanelServiceServer) ProcessCommand(grpc.BidiStreamingServer[UtmCommand, CommandResult]) error
type UnimplementedPingServiceServer ¶
type UnimplementedPingServiceServer struct{}
UnimplementedPingServiceServer 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.
type UnsafeAgentServiceServer ¶
type UnsafeAgentServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AgentServiceServer will result in compilation errors.
type UnsafePanelServiceServer ¶
type UnsafePanelServiceServer interface {
// contains filtered or unexported methods
}
UnsafePanelServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PanelServiceServer will result in compilation errors.
type UnsafePingServiceServer ¶
type UnsafePingServiceServer interface {
// contains filtered or unexported methods
}
UnsafePingServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PingServiceServer will result in compilation errors.
type UtmCommand ¶
type UtmCommand struct {
AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
ExecutedBy string `protobuf:"bytes,3,opt,name=executed_by,json=executedBy,proto3" json:"executed_by,omitempty"`
CmdId string `protobuf:"bytes,4,opt,name=cmd_id,json=cmdId,proto3" json:"cmd_id,omitempty"`
OriginType string `protobuf:"bytes,5,opt,name=origin_type,json=originType,proto3" json:"origin_type,omitempty"`
OriginId string `protobuf:"bytes,6,opt,name=origin_id,json=originId,proto3" json:"origin_id,omitempty"`
Reason string `protobuf:"bytes,7,opt,name=reason,proto3" json:"reason,omitempty"`
Shell string `protobuf:"bytes,8,opt,name=shell,proto3" json:"shell,omitempty"` // Shell to execute command: "cmd", "powershell" (Windows), "sh", "bash" (Linux/macOS). Empty = default
// contains filtered or unexported fields
}
func (*UtmCommand) Descriptor
deprecated
func (*UtmCommand) Descriptor() ([]byte, []int)
Deprecated: Use UtmCommand.ProtoReflect.Descriptor instead.
func (*UtmCommand) GetAgentId ¶
func (x *UtmCommand) GetAgentId() string
func (*UtmCommand) GetCmdId ¶
func (x *UtmCommand) GetCmdId() string
func (*UtmCommand) GetCommand ¶
func (x *UtmCommand) GetCommand() string
func (*UtmCommand) GetExecutedBy ¶
func (x *UtmCommand) GetExecutedBy() string
func (*UtmCommand) GetOriginId ¶
func (x *UtmCommand) GetOriginId() string
func (*UtmCommand) GetOriginType ¶
func (x *UtmCommand) GetOriginType() string
func (*UtmCommand) GetReason ¶
func (x *UtmCommand) GetReason() string
func (*UtmCommand) GetShell ¶
func (x *UtmCommand) GetShell() string
func (*UtmCommand) ProtoMessage ¶
func (*UtmCommand) ProtoMessage()
func (*UtmCommand) ProtoReflect ¶
func (x *UtmCommand) ProtoReflect() protoreflect.Message
func (*UtmCommand) Reset ¶
func (x *UtmCommand) Reset()
func (*UtmCommand) String ¶
func (x *UtmCommand) String() string