Documentation
¶
Index ¶
- Variables
- type AgentInfo
- func (*AgentInfo) Descriptor() ([]byte, []int)deprecated
- func (x *AgentInfo) GetAgentId() string
- func (x *AgentInfo) GetArchitecture() string
- func (x *AgentInfo) GetCapabilities() []string
- func (x *AgentInfo) GetFirstSeen() int64
- func (x *AgentInfo) GetHostname() string
- func (x *AgentInfo) GetLastSeen() int64
- func (x *AgentInfo) GetOsInfo() string
- func (x *AgentInfo) GetUsername() string
- func (*AgentInfo) ProtoMessage()
- func (x *AgentInfo) ProtoReflect() protoreflect.Message
- func (x *AgentInfo) Reset()
- func (x *AgentInfo) String() string
- type AgentStatus
- func (AgentStatus) Descriptor() protoreflect.EnumDescriptor
- func (x AgentStatus) Enum() *AgentStatus
- func (AgentStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x AgentStatus) Number() protoreflect.EnumNumber
- func (x AgentStatus) String() string
- func (AgentStatus) Type() protoreflect.EnumType
- type Heartbeat
- func (*Heartbeat) Descriptor() ([]byte, []int)deprecated
- func (x *Heartbeat) GetAgentId() string
- func (x *Heartbeat) GetPendingTasks() []string
- func (x *Heartbeat) GetStatus() AgentStatus
- func (x *Heartbeat) GetTimestamp() int64
- func (*Heartbeat) ProtoMessage()
- func (x *Heartbeat) ProtoReflect() protoreflect.Message
- func (x *Heartbeat) Reset()
- func (x *Heartbeat) String() string
- type Registration
- func (*Registration) Descriptor() ([]byte, []int)deprecated
- func (x *Registration) GetAgentInfo() *AgentInfo
- func (x *Registration) GetProtocolVersion() string
- func (x *Registration) GetPublicKey() []byte
- func (*Registration) ProtoMessage()
- func (x *Registration) ProtoReflect() protoreflect.Message
- func (x *Registration) Reset()
- func (x *Registration) String() string
- type ResponseType
- func (ResponseType) Descriptor() protoreflect.EnumDescriptor
- func (x ResponseType) Enum() *ResponseType
- func (ResponseType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ResponseType) Number() protoreflect.EnumNumber
- func (x ResponseType) String() string
- func (ResponseType) Type() protoreflect.EnumType
- type ServerResponse
- func (*ServerResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ServerResponse) GetData() []byte
- func (x *ServerResponse) GetError() string
- func (x *ServerResponse) GetMessageId() string
- func (x *ServerResponse) GetType() ResponseType
- func (*ServerResponse) ProtoMessage()
- func (x *ServerResponse) ProtoReflect() protoreflect.Message
- func (x *ServerResponse) Reset()
- func (x *ServerResponse) String() string
- type Task
- func (*Task) Descriptor() ([]byte, []int)deprecated
- func (x *Task) GetArguments() []string
- func (x *Task) GetCommand() string
- func (x *Task) GetTaskId() string
- func (x *Task) GetTimeout() int32
- func (x *Task) GetTimestamp() int64
- func (*Task) ProtoMessage()
- func (x *Task) ProtoReflect() protoreflect.Message
- func (x *Task) Reset()
- func (x *Task) String() string
- type TaskResult
- func (*TaskResult) Descriptor() ([]byte, []int)deprecated
- func (x *TaskResult) GetAgentId() string
- func (x *TaskResult) GetError() []byte
- func (x *TaskResult) GetExitCode() int32
- func (x *TaskResult) GetOutput() []byte
- func (x *TaskResult) GetTaskId() string
- func (x *TaskResult) GetTimestamp() int64
- func (*TaskResult) ProtoMessage()
- func (x *TaskResult) ProtoReflect() protoreflect.Message
- func (x *TaskResult) Reset()
- func (x *TaskResult) String() string
Constants ¶
This section is empty.
Variables ¶
var ( AgentStatus_name = map[int32]string{ 0: "UNKNOWN", 1: "ACTIVE", 2: "SLEEPING", 3: "DEAD", } AgentStatus_value = map[string]int32{ "UNKNOWN": 0, "ACTIVE": 1, "SLEEPING": 2, "DEAD": 3, } )
Enum value maps for AgentStatus.
var ( ResponseType_name = map[int32]string{ 0: "NONE", 1: "TASK", 2: "CONFIG", 3: "ERROR", 4: "ACK", } ResponseType_value = map[string]int32{ "NONE": 0, "TASK": 1, "CONFIG": 2, "ERROR": 3, "ACK": 4, } )
Enum value maps for ResponseType.
var File_proto_c2_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AgentInfo ¶
type AgentInfo struct { AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` OsInfo string `protobuf:"bytes,4,opt,name=os_info,json=osInfo,proto3" json:"os_info,omitempty"` Architecture string `protobuf:"bytes,5,opt,name=architecture,proto3" json:"architecture,omitempty"` Capabilities []string `protobuf:"bytes,6,rep,name=capabilities,proto3" json:"capabilities,omitempty"` FirstSeen int64 `protobuf:"varint,7,opt,name=first_seen,json=firstSeen,proto3" json:"first_seen,omitempty"` LastSeen int64 `protobuf:"varint,8,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` // contains filtered or unexported fields }
AgentInfo contains information about the agent
func (*AgentInfo) Descriptor
deprecated
func (*AgentInfo) GetAgentId ¶
func (*AgentInfo) GetArchitecture ¶
func (*AgentInfo) GetCapabilities ¶
func (*AgentInfo) GetFirstSeen ¶
func (*AgentInfo) GetHostname ¶
func (*AgentInfo) GetLastSeen ¶
func (*AgentInfo) GetUsername ¶
func (*AgentInfo) ProtoMessage ¶
func (*AgentInfo) ProtoMessage()
func (*AgentInfo) ProtoReflect ¶
func (x *AgentInfo) ProtoReflect() protoreflect.Message
type AgentStatus ¶
type AgentStatus int32
AgentStatus represents the current state of the agent
const ( AgentStatus_UNKNOWN AgentStatus = 0 AgentStatus_ACTIVE AgentStatus = 1 AgentStatus_SLEEPING AgentStatus = 2 AgentStatus_DEAD AgentStatus = 3 )
func (AgentStatus) Descriptor ¶
func (AgentStatus) Descriptor() protoreflect.EnumDescriptor
func (AgentStatus) Enum ¶
func (x AgentStatus) Enum() *AgentStatus
func (AgentStatus) EnumDescriptor
deprecated
func (AgentStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use AgentStatus.Descriptor instead.
func (AgentStatus) Number ¶
func (x AgentStatus) Number() protoreflect.EnumNumber
func (AgentStatus) String ¶
func (x AgentStatus) String() string
func (AgentStatus) Type ¶
func (AgentStatus) Type() protoreflect.EnumType
type Heartbeat ¶
type Heartbeat struct { AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Status AgentStatus `protobuf:"varint,3,opt,name=status,proto3,enum=c2.AgentStatus" json:"status,omitempty"` PendingTasks []string `protobuf:"bytes,4,rep,name=pending_tasks,json=pendingTasks,proto3" json:"pending_tasks,omitempty"` // contains filtered or unexported fields }
Heartbeat is used for agent-server communication
func (*Heartbeat) Descriptor
deprecated
func (*Heartbeat) GetAgentId ¶
func (*Heartbeat) GetPendingTasks ¶
func (*Heartbeat) GetStatus ¶
func (x *Heartbeat) GetStatus() AgentStatus
func (*Heartbeat) GetTimestamp ¶
func (*Heartbeat) ProtoMessage ¶
func (*Heartbeat) ProtoMessage()
func (*Heartbeat) ProtoReflect ¶
func (x *Heartbeat) ProtoReflect() protoreflect.Message
type Registration ¶
type Registration struct { AgentInfo *AgentInfo `protobuf:"bytes,1,opt,name=agent_info,json=agentInfo,proto3" json:"agent_info,omitempty"` PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` ProtocolVersion string `protobuf:"bytes,3,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // contains filtered or unexported fields }
Registration is used when an agent first connects to the server
func (*Registration) Descriptor
deprecated
func (*Registration) Descriptor() ([]byte, []int)
Deprecated: Use Registration.ProtoReflect.Descriptor instead.
func (*Registration) GetAgentInfo ¶
func (x *Registration) GetAgentInfo() *AgentInfo
func (*Registration) GetProtocolVersion ¶
func (x *Registration) GetProtocolVersion() string
func (*Registration) GetPublicKey ¶
func (x *Registration) GetPublicKey() []byte
func (*Registration) ProtoMessage ¶
func (*Registration) ProtoMessage()
func (*Registration) ProtoReflect ¶
func (x *Registration) ProtoReflect() protoreflect.Message
func (*Registration) Reset ¶
func (x *Registration) Reset()
func (*Registration) String ¶
func (x *Registration) String() string
type ResponseType ¶
type ResponseType int32
ResponseType indicates the type of server response
const ( ResponseType_NONE ResponseType = 0 ResponseType_TASK ResponseType = 1 ResponseType_CONFIG ResponseType = 2 ResponseType_ERROR ResponseType = 3 ResponseType_ACK ResponseType = 4 )
func (ResponseType) Descriptor ¶
func (ResponseType) Descriptor() protoreflect.EnumDescriptor
func (ResponseType) Enum ¶
func (x ResponseType) Enum() *ResponseType
func (ResponseType) EnumDescriptor
deprecated
func (ResponseType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ResponseType.Descriptor instead.
func (ResponseType) Number ¶
func (x ResponseType) Number() protoreflect.EnumNumber
func (ResponseType) String ¶
func (x ResponseType) String() string
func (ResponseType) Type ¶
func (ResponseType) Type() protoreflect.EnumType
type ServerResponse ¶
type ServerResponse struct { MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` Type ResponseType `protobuf:"varint,2,opt,name=type,proto3,enum=c2.ResponseType" json:"type,omitempty"` Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
ServerResponse is the generic response from the server
func (*ServerResponse) Descriptor
deprecated
func (*ServerResponse) Descriptor() ([]byte, []int)
Deprecated: Use ServerResponse.ProtoReflect.Descriptor instead.
func (*ServerResponse) GetData ¶
func (x *ServerResponse) GetData() []byte
func (*ServerResponse) GetError ¶
func (x *ServerResponse) GetError() string
func (*ServerResponse) GetMessageId ¶
func (x *ServerResponse) GetMessageId() string
func (*ServerResponse) GetType ¶
func (x *ServerResponse) GetType() ResponseType
func (*ServerResponse) ProtoMessage ¶
func (*ServerResponse) ProtoMessage()
func (*ServerResponse) ProtoReflect ¶
func (x *ServerResponse) ProtoReflect() protoreflect.Message
func (*ServerResponse) Reset ¶
func (x *ServerResponse) Reset()
func (*ServerResponse) String ¶
func (x *ServerResponse) String() string
type Task ¶
type Task struct { TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"` Arguments []string `protobuf:"bytes,3,rep,name=arguments,proto3" json:"arguments,omitempty"` Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Timeout int32 `protobuf:"varint,5,opt,name=timeout,proto3" json:"timeout,omitempty"` // contains filtered or unexported fields }
Task represents a command to be executed by the agent
func (*Task) Descriptor
deprecated
func (*Task) GetArguments ¶
func (*Task) GetCommand ¶
func (*Task) GetTimeout ¶
func (*Task) GetTimestamp ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
func (*Task) ProtoReflect ¶
func (x *Task) ProtoReflect() protoreflect.Message
type TaskResult ¶
type TaskResult struct { TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` Output []byte `protobuf:"bytes,4,opt,name=output,proto3" json:"output,omitempty"` Error []byte `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` Timestamp int64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
TaskResult contains the output of a executed task
func (*TaskResult) Descriptor
deprecated
func (*TaskResult) Descriptor() ([]byte, []int)
Deprecated: Use TaskResult.ProtoReflect.Descriptor instead.
func (*TaskResult) GetAgentId ¶
func (x *TaskResult) GetAgentId() string
func (*TaskResult) GetError ¶
func (x *TaskResult) GetError() []byte
func (*TaskResult) GetExitCode ¶
func (x *TaskResult) GetExitCode() int32
func (*TaskResult) GetOutput ¶
func (x *TaskResult) GetOutput() []byte
func (*TaskResult) GetTaskId ¶
func (x *TaskResult) GetTaskId() string
func (*TaskResult) GetTimestamp ¶
func (x *TaskResult) GetTimestamp() int64
func (*TaskResult) ProtoMessage ¶
func (*TaskResult) ProtoMessage()
func (*TaskResult) ProtoReflect ¶
func (x *TaskResult) ProtoReflect() protoreflect.Message
func (*TaskResult) Reset ¶
func (x *TaskResult) Reset()
func (*TaskResult) String ¶
func (x *TaskResult) String() string