Documentation
¶
Index ¶
- Constants
- type AgentArch
- type AgentOs
- type Capability
- func (c Capability) Marshal(data any) ([]byte, error)
- func (c *Capability) Scan(val any) error
- func (c Capability) String() string
- func (c Capability) Unmarshal(data []byte) (any, error)
- func (c Capability) ValidateMask(cap uint32) bool
- func (c Capability) Value() (driver.Value, error)
- func (Capability) Values() []string
- type TaskMessage
- type TaskStatus
Constants ¶
const ( // maximum length of operator's username OperatorUsernameMaxLength = 256 // minimum length of operator's username OperatorUsernameMinLength = 3 )
const ( // maximum length of listener' name ListenerNameMaxLength = 256 // maximum length of listener's note ListenerNoteMaxLength = 256 )
const ( // maximum length of agent's operating system meta information AgentOsMetaMaxLength = 1024 // maximum length of agent's hostname AgentHostnameMaxLength = 256 // maximum length of agent's username AgentUsernameMaxLength = 256 // maximum length of agent's domain AgentDomainMaxLength = 256 // maximum length of agent's process name AgentProcessNameMaxLength = 1024 // maximum length of agent's note AgentNoteMaxLength = 256 )
const ( // minimum length of chat's message ChatMessageMinLength = 1 // maximum length of chat's message ChatMessageMaxLength = 4096 )
const ( // maximum length of credential's username CredentialUsernameMaxLength = 256 // maximum length of credential's secret CredentialSecretMaxLength = 4096 // maximum length of credential's realm CredentialRealmMaxLength = 256 // maximum length of credential's host CredentialHostMaxLength = 256 // maximum length of credential's note CredentialNoteMaxLength = 256 )
const ( // minimum length of task group command line TaskGroupCmdMinLength = 1 // maximum length of task group command line TaskGroupCmdMaxLength = 4096 // maximum length of message in task group TaskGroupMessageMaxLength = 4096 )
const ( // maximum length of single protobuf message (2GB) MaxProtobufMessageSize = 2 * 1024 * 1024 * 1024 // Name of listener's authorization header GrpcAuthListenerHeader = "X-Access-Token" // Name of operator's authorization header GrpcAuthOperatorHeader = "Y-Access-Token" // Name of managements authorization header GrpcAuthManagementHeader = "Z-Access-Token" )
const ( // default color used in process of object's creation DefaultObjectColor = uint32(0) )
const (
// maximum size of task's output that can be printed
TaskOutputMaxShowSize = 1 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentArch ¶
type AgentArch uint8
represents custom type to hold agent's architecture type
type AgentOs ¶
type AgentOs uint8
represents custom type to hold agent's operating system type
func (AgentOs) StringShort ¶
String returns short string representation of operating system type
type Capability ¶
type Capability uint32
represents custom type to hold capabilities
const ( CapExit Capability = 0 CapSleep Capability = 1 CapCp Capability = 2 << 0 CapCd Capability = 2 << 1 CapWhoami Capability = 2 << 2 CapJobkill Capability = 2 << 3 CapCat Capability = 2 << 4 CapExec Capability = 2 << 5 CapPwd Capability = 2 << 6 CapJobs Capability = 2 << 7 CapPs Capability = 2 << 8 CapLs Capability = 2 << 9 CapPause Capability = 2 << 10 CapMkdir Capability = 2 << 11 CapRm Capability = 2 << 12 CapShell Capability = 2 << 13 CapShellcodeInjection Capability = 2 << 14 CapUpload Capability = 2 << 15 CapKill Capability = 2 << 16 CapMv Capability = 2 << 17 CapDestroy Capability = 2 << 18 CapExecDetach Capability = 2 << 19 CapExecAssembly Capability = 2 << 20 CapPpid Capability = 2 << 21 CapDownload Capability = 2 << 22 )
func SupportedCaps ¶
func SupportedCaps(mask uint32) []Capability
SupportedCaps returns list of capabilities contained in binary mask
func (Capability) Marshal ¶
func (c Capability) Marshal(data any) ([]byte, error)
Marshal converts proto message to byte array
func (*Capability) Scan ¶
func (c *Capability) Scan(val any) error
Scan converts value to capability
func (Capability) String ¶
func (c Capability) String() string
String returns string representation of capabilities
func (Capability) Unmarshal ¶
func (c Capability) Unmarshal(data []byte) (any, error)
Unmarshal converts raw binary to proto message
func (Capability) ValidateMask ¶
func (c Capability) ValidateMask(cap uint32) bool
ValidateMask validates if capability presents in binary mask
func (Capability) Value ¶
func (c Capability) Value() (driver.Value, error)
Value return database ready value for further processing
func (Capability) Values ¶
func (Capability) Values() []string
Values returns list of strings represented names of capabilities types
type TaskMessage ¶
type TaskMessage uint8
represents custom type to hold task messages
const ( NotifyMessage TaskMessage = iota InfoMessage WarningMessage ErrorMessage )
func (*TaskMessage) Scan ¶
func (t *TaskMessage) Scan(val any) error
Scan converts value to capability
func (TaskMessage) String ¶
func (t TaskMessage) String() string
String returns string representation of task messages types
func (TaskMessage) Value ¶
func (t TaskMessage) Value() (driver.Value, error)
Value return database ready value for further processing
func (TaskMessage) Values ¶
func (t TaskMessage) Values() []string
Values returns list of strings represented names of task messages
type TaskStatus ¶
type TaskStatus uint8
represents custom type to hold task's status
const ( StatusNew TaskStatus = iota StatusInProgress StatusCancelled StatusSuccess StatusError )
func (*TaskStatus) Scan ¶
func (t *TaskStatus) Scan(val any) error
Scan converts value to task status
func (TaskStatus) String ¶
func (t TaskStatus) String() string
String returns string representation of task's status
func (TaskStatus) Value ¶
func (t TaskStatus) Value() (driver.Value, error)
Value return database ready value for further processing
func (TaskStatus) Values ¶
func (TaskStatus) Values() []string
Values returns list of strings represented names of task's statuses