shared

package
v0.0.0-...-f35177d Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// maximum length of operator's username
	OperatorUsernameMaxLength = 256
	// minimum length of operator's username
	OperatorUsernameMinLength = 3
)
View Source
const (
	// maximum length of listener' name
	ListenerNameMaxLength = 256
	// maximum length of listener's note
	ListenerNoteMaxLength = 256
)
View Source
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
)
View Source
const (
	// minimum length of chat's message
	ChatMessageMinLength = 1
	// maximum length of chat's message
	ChatMessageMaxLength = 4096
)
View Source
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
)
View Source
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
)
View Source
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"
)
View Source
const (
	// default color used in process of object's creation
	DefaultObjectColor = uint32(0)
)
View Source
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

const (
	ArchUnknown AgentArch = iota
	ArchX86
	ArchX64
	ArchArm32
	ArchArm64
)

func (*AgentArch) Scan

func (a *AgentArch) Scan(val any) error

Scan converts value to arch type

func (AgentArch) String

func (a AgentArch) String() string

String returns string representation of arch types

func (AgentArch) Value

func (a AgentArch) Value() (driver.Value, error)

Value return database ready value for further processing

func (AgentArch) Values

func (AgentArch) Values() []string

Values returns list of strings represented names of arch types

type AgentOs

type AgentOs uint8

represents custom type to hold agent's operating system type

const (
	OsUnknown AgentOs = iota
	OsLinux
	OsWindows
	OsMac
)

func (*AgentOs) Scan

func (a *AgentOs) Scan(val any) error

Scan converts value to operating system type

func (AgentOs) String

func (a AgentOs) String() string

String returns string representation of operating system type

func (AgentOs) StringShort

func (a AgentOs) StringShort() string

String returns short string representation of operating system type

func (AgentOs) Value

func (a AgentOs) Value() (driver.Value, error)

Value return database ready value for further processing

func (AgentOs) Values

func (AgentOs) Values() []string

Values returns list of strings represented names of capability types

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

Jump to

Keyboard shortcuts

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