Documentation
¶
Index ¶
- Constants
- func DefaultCWD(platform string) string
- type Command
- type HistoryEntry
- type Manager
- func (m *Manager) CloseSession(sessionID uint) error
- func (m *Manager) CommandResults(commandID uint) ([]map[string]any, error)
- func (m *Manager) CreateSession(env environments.TLSEnvironment, node nodes.OsqueryNode, creator string) (Session, error)
- func (m *Manager) GetCommand(sessionID, commandID uint) (Command, error)
- func (m *Manager) GetSession(sessionID uint) (Session, error)
- func (m *Manager) History(envID, nodeID uint, creator string, limit int) ([]HistoryEntry, error)
- func (m *Manager) RefreshCommandStatus(commandID uint) (Command, error)
- func (m *Manager) SubmitCommand(sessionID uint, input string, osqueryModeOpt ...bool) (Command, ParsedCommand, error)
- func (m *Manager) SubmitCommandWithTimeout(sessionID uint, input string, timeout time.Duration, osqueryModeOpt ...bool) (Command, ParsedCommand, error)
- func (m *Manager) TouchSession(sessionID uint) (Session, error)
- type ParsedCommand
- type Session
Constants ¶
View Source
const ( CommandLocal = "local" CommandRemote = "remote" CommandCarve = "carve" CommandMode = "mode" CommandExitMode = "exit-mode" StatusQueued = "queued" StatusDelivered = "delivered" StatusCompleted = "completed" StatusError = "error" StatusExpired = "expired" )
Variables ¶
This section is empty.
Functions ¶
func DefaultCWD ¶
Types ¶
type Command ¶
type Command struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
SessionID uint `gorm:"not null;index" json:"session_id"`
Input string `gorm:"not null" json:"input"`
TranslatedSQL string `json:"translated_sql"`
DistributedQueryName string `gorm:"index" json:"distributed_query_name,omitempty"`
Status string `gorm:"not null;index" json:"status"`
Error string `json:"error,omitempty"`
DeliveredAt *time.Time `json:"delivered_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
ExpiredAt *time.Time `json:"expired_at,omitempty"`
}
type HistoryEntry ¶
type Manager ¶
func (*Manager) CloseSession ¶
func (*Manager) CommandResults ¶
func (*Manager) CreateSession ¶
func (m *Manager) CreateSession(env environments.TLSEnvironment, node nodes.OsqueryNode, creator string) (Session, error)
func (*Manager) GetCommand ¶
func (*Manager) RefreshCommandStatus ¶
func (*Manager) SubmitCommand ¶
func (*Manager) SubmitCommandWithTimeout ¶
type ParsedCommand ¶
type ParsedCommand struct {
Kind string `json:"kind"`
Command string `json:"command"`
Mode string `json:"mode,omitempty"`
Path string `json:"path,omitempty"`
SQL string `json:"sql,omitempty"`
Output string `json:"output,omitempty"`
Message string `json:"message,omitempty"`
}
func Parse ¶
func Parse(input, cwd, platform string) (ParsedCommand, error)
func ParseInput ¶
func ParseInput(input, cwd, platform string, osqueryMode bool) (ParsedCommand, error)
type Session ¶
type Session struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
EnvironmentID uint `gorm:"not null;index" json:"environment_id"`
NodeID uint `gorm:"not null;index" json:"node_id"`
NodeUUID string `gorm:"not null;index" json:"node_uuid"`
Creator string `gorm:"not null;index" json:"creator"`
CWD string `gorm:"not null" json:"cwd"`
Platform string `json:"platform"`
Active bool `gorm:"not null;default:true" json:"active"`
ClosedAt *time.Time `json:"closed_at,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.