logger

package
v0.0.0-...-6a41818 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package logger is a standardized event logging framework for the honeypot.

Index

Constants

This section is empty.

Variables

View Source
var (
	OperationResult_name = map[int32]string{
		0: "UNKNOWN",
		1: "SUCCESS",
		2: "FAILURE",
	}
	OperationResult_value = map[string]int32{
		"UNKNOWN": 0,
		"SUCCESS": 1,
		"FAILURE": 2,
	}
)

Enum value maps for OperationResult.

View Source
var (
	UnknownCommand_UnknownCommandStatus_name = map[int32]string{
		0: "UNKNOWN",
		1: "NOT_FOUND",
		2: "NOT_IMPLEMENTED",
		3: "LOOKUP_ERROR",
	}
	UnknownCommand_UnknownCommandStatus_value = map[string]int32{
		"UNKNOWN":         0,
		"NOT_FOUND":       1,
		"NOT_IMPLEMENTED": 2,
		"LOOKUP_ERROR":    3,
	}
)

Enum value maps for UnknownCommand_UnknownCommandStatus.

View Source
var (
	HoneypotEvent_Type_name = map[int32]string{
		0: "UNKNOWN",
		1: "START",
		2: "TERMINATE",
	}
	HoneypotEvent_Type_value = map[string]int32{
		"UNKNOWN":   0,
		"START":     1,
		"TERMINATE": 2,
	}
)

Enum value maps for HoneypotEvent_Type.

Functions

func ReadJSONLinesLog

func ReadJSONLinesLog(r io.Reader, handler func(le *LogEntry)) error

ReadJSONLinesLog parses a newline delimited JSON log.

Types

type BugReport

type BugReport struct {
	LogEntries int

	InvalidInvocations *PathCounter `json:"invalid_invocations"`
	UnknownCommands    *PathCounter `json:"unknown_commands"`
	Panics             []*Panic     `json:"panics"`
}

BugReport pulls events that are likely bugs in the honeypot.

func NewBugReport

func NewBugReport() *BugReport

func (*BugReport) Update

func (r *BugReport) Update(le *LogEntry)

type ConnectionLost

type ConnectionLost struct {
	// contains filtered or unexported fields
}

func (*ConnectionLost) Descriptor deprecated

func (*ConnectionLost) Descriptor() ([]byte, []int)

Deprecated: Use ConnectionLost.ProtoReflect.Descriptor instead.

func (*ConnectionLost) MarshalJSON

func (msg *ConnectionLost) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*ConnectionLost) ProtoMessage

func (*ConnectionLost) ProtoMessage()

func (*ConnectionLost) ProtoReflect

func (x *ConnectionLost) ProtoReflect() protoreflect.Message

func (*ConnectionLost) Reset

func (x *ConnectionLost) Reset()

func (*ConnectionLost) String

func (x *ConnectionLost) String() string

func (*ConnectionLost) UnmarshalJSON

func (msg *ConnectionLost) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type Credentials

type Credentials struct {

	// Username used to authenticate.
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	// Password used to authenticate.
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// Private key used to authenticate.
	PrivateKey []byte `protobuf:"bytes,3,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
	// contains filtered or unexported fields
}

A set of credentials that the honeypot collected.

func (*Credentials) Descriptor deprecated

func (*Credentials) Descriptor() ([]byte, []int)

Deprecated: Use Credentials.ProtoReflect.Descriptor instead.

func (*Credentials) GetPassword

func (x *Credentials) GetPassword() string

func (*Credentials) GetPrivateKey

func (x *Credentials) GetPrivateKey() []byte

func (*Credentials) GetUsername

func (x *Credentials) GetUsername() string

func (*Credentials) MarshalJSON

func (msg *Credentials) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Credentials) ProtoMessage

func (*Credentials) ProtoMessage()

func (*Credentials) ProtoReflect

func (x *Credentials) ProtoReflect() protoreflect.Message

func (*Credentials) Reset

func (x *Credentials) Reset()

func (*Credentials) String

func (x *Credentials) String() string

func (*Credentials) UnmarshalJSON

func (msg *Credentials) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type CredentialsReport

type CredentialsReport struct {
}

type Download

type Download struct {

	// Name of the download.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Source of the download.
	Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
	// Command that generated the download.
	Command []string `protobuf:"bytes,3,rep,name=command,proto3" json:"command,omitempty"`
	// contains filtered or unexported fields
}

Information about a downloaded file.

func (*Download) Descriptor deprecated

func (*Download) Descriptor() ([]byte, []int)

Deprecated: Use Download.ProtoReflect.Descriptor instead.

func (*Download) GetCommand

func (x *Download) GetCommand() []string

func (*Download) GetName

func (x *Download) GetName() string

func (*Download) GetSource

func (x *Download) GetSource() string

func (*Download) MarshalJSON

func (msg *Download) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Download) ProtoMessage

func (*Download) ProtoMessage()

func (*Download) ProtoReflect

func (x *Download) ProtoReflect() protoreflect.Message

func (*Download) Reset

func (x *Download) Reset()

func (*Download) String

func (x *Download) String() string

func (*Download) UnmarshalJSON

func (msg *Download) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type DownloadReport

type DownloadReport struct {
	Count        int        `json:"count"`
	Sources      StrCounter `json:"sources"`
	CommandNames StrCounter `json:"command_counts"`
}

type FilesystemOp

type FilesystemOp struct {
	// contains filtered or unexported fields
}

func (*FilesystemOp) Descriptor deprecated

func (*FilesystemOp) Descriptor() ([]byte, []int)

Deprecated: Use FilesystemOp.ProtoReflect.Descriptor instead.

func (*FilesystemOp) MarshalJSON

func (msg *FilesystemOp) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*FilesystemOp) ProtoMessage

func (*FilesystemOp) ProtoMessage()

func (*FilesystemOp) ProtoReflect

func (x *FilesystemOp) ProtoReflect() protoreflect.Message

func (*FilesystemOp) Reset

func (x *FilesystemOp) Reset()

func (*FilesystemOp) String

func (x *FilesystemOp) String() string

func (*FilesystemOp) UnmarshalJSON

func (msg *FilesystemOp) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type HoneypotEvent

type HoneypotEvent struct {

	// Context about what was going on before the panic.
	EventType HoneypotEvent_Type `protobuf:"varint,1,opt,name=event_type,json=eventType,proto3,enum=HoneypotEvent_Type" json:"event_type,omitempty"`
	// contains filtered or unexported fields
}

Information about a honeypot status.

func (*HoneypotEvent) Descriptor deprecated

func (*HoneypotEvent) Descriptor() ([]byte, []int)

Deprecated: Use HoneypotEvent.ProtoReflect.Descriptor instead.

func (*HoneypotEvent) GetEventType

func (x *HoneypotEvent) GetEventType() HoneypotEvent_Type

func (*HoneypotEvent) MarshalJSON

func (msg *HoneypotEvent) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*HoneypotEvent) ProtoMessage

func (*HoneypotEvent) ProtoMessage()

func (*HoneypotEvent) ProtoReflect

func (x *HoneypotEvent) ProtoReflect() protoreflect.Message

func (*HoneypotEvent) Reset

func (x *HoneypotEvent) Reset()

func (*HoneypotEvent) String

func (x *HoneypotEvent) String() string

func (*HoneypotEvent) UnmarshalJSON

func (msg *HoneypotEvent) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type HoneypotEvent_Type

type HoneypotEvent_Type int32
const (
	HoneypotEvent_UNKNOWN   HoneypotEvent_Type = 0
	HoneypotEvent_START     HoneypotEvent_Type = 1 // Honeypot started
	HoneypotEvent_TERMINATE HoneypotEvent_Type = 2 // Honeypot shutting down.
)

func (HoneypotEvent_Type) Descriptor

func (HoneypotEvent_Type) Enum

func (HoneypotEvent_Type) EnumDescriptor deprecated

func (HoneypotEvent_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use HoneypotEvent_Type.Descriptor instead.

func (HoneypotEvent_Type) Number

func (HoneypotEvent_Type) String

func (x HoneypotEvent_Type) String() string

func (HoneypotEvent_Type) Type

type InteractionReport

type InteractionReport struct {
	// contains filtered or unexported fields
}

func (*InteractionReport) MarshalJSON

func (i *InteractionReport) MarshalJSON() ([]byte, error)

MarshalJSON implemnts custom JSON marshaler.

func (*InteractionReport) Update

func (i *InteractionReport) Update(le *LogEntry)

type InteractiveSession

type InteractiveSession struct {
	Login struct {
		Username   string `json:"username"`
		Password   string `json:"password"`
		PublicKey  []byte `json:"public_key,omitempty"`
		RemoteAddr string `json:"remote_addr,omitempty"`
	} `json:"login"`
	TTYLog       string `json:"tty_log"`
	LogEntries   int    `json:"log_entries"`
	TerminalName string `json:"terminal_name"`
	IsPty        bool   `json:"is_pty"`

	Commands  []string `json:"commands"`
	Downloads []string `json:"downloads"`
}

func (*InteractiveSession) Update

func (i *InteractiveSession) Update(le *LogEntry)

type InvalidInvocation

type InvalidInvocation struct {
	Command []string `protobuf:"bytes,1,rep,name=command,proto3" json:"command,omitempty"`
	Error   string   `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// The name of the file logging the error.
	SourceFile string `protobuf:"bytes,3,opt,name=source_file,json=sourceFile,proto3" json:"source_file,omitempty"`
	// The line of the file logging the error.
	SourceLine uint32 `protobuf:"varint,4,opt,name=source_line,json=sourceLine,proto3" json:"source_line,omitempty"`
	// The module version of the program.
	ModVersion string `protobuf:"bytes,5,opt,name=mod_version,json=modVersion,proto3" json:"mod_version,omitempty"`
	// The checksum of the program.
	ModSum string `protobuf:"bytes,6,opt,name=mod_sum,json=modSum,proto3" json:"mod_sum,omitempty"`
	// contains filtered or unexported fields
}

A potential missing Honeypot feature, should be reported or fixed.

func (*InvalidInvocation) Descriptor deprecated

func (*InvalidInvocation) Descriptor() ([]byte, []int)

Deprecated: Use InvalidInvocation.ProtoReflect.Descriptor instead.

func (*InvalidInvocation) GetCommand

func (x *InvalidInvocation) GetCommand() []string

func (*InvalidInvocation) GetError

func (x *InvalidInvocation) GetError() string

func (*InvalidInvocation) GetModSum

func (x *InvalidInvocation) GetModSum() string

func (*InvalidInvocation) GetModVersion

func (x *InvalidInvocation) GetModVersion() string

func (*InvalidInvocation) GetSourceFile

func (x *InvalidInvocation) GetSourceFile() string

func (*InvalidInvocation) GetSourceLine

func (x *InvalidInvocation) GetSourceLine() uint32

func (*InvalidInvocation) MarshalJSON

func (msg *InvalidInvocation) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*InvalidInvocation) ProtoMessage

func (*InvalidInvocation) ProtoMessage()

func (*InvalidInvocation) ProtoReflect

func (x *InvalidInvocation) ProtoReflect() protoreflect.Message

func (*InvalidInvocation) Reset

func (x *InvalidInvocation) Reset()

func (*InvalidInvocation) String

func (x *InvalidInvocation) String() string

func (*InvalidInvocation) UnmarshalJSON

func (msg *InvalidInvocation) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type InvalidInvocationReport

type InvalidInvocationReport struct {
	CommandNames StrCounter `json:"command_counts"`
}

type LogEntry

type LogEntry struct {

	// Timestamp of the log event in micros since the UNIX epoch.
	TimestampMicros int64 `protobuf:"varint,1,opt,name=timestamp_micros,json=timestampMicros,proto3" json:"timestamp_micros,omitempty"`
	// Unique session identifier for the log message. Blank if the event
	// wasn't in the context of a session.
	SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// Types that are assignable to LogType:
	//	*LogEntry_LoginAttempt
	//	*LogEntry_FilesystemOperation
	//	*LogEntry_OpenTtyLog
	//	*LogEntry_ConnectionLost
	//	*LogEntry_RunCommand
	//	*LogEntry_UnknownCommand
	//	*LogEntry_TerminalUpdate
	//	*LogEntry_OpenFile
	//	*LogEntry_InvalidInvocation
	//	*LogEntry_UsedCredentials
	//	*LogEntry_Download
	//	*LogEntry_Panic
	//	*LogEntry_HoneypotEvent
	LogType isLogEntry_LogType `protobuf_oneof:"log_type"`
	// contains filtered or unexported fields
}

func (*LogEntry) Descriptor deprecated

func (*LogEntry) Descriptor() ([]byte, []int)

Deprecated: Use LogEntry.ProtoReflect.Descriptor instead.

func (*LogEntry) GetConnectionLost

func (x *LogEntry) GetConnectionLost() *ConnectionLost

func (*LogEntry) GetDownload

func (x *LogEntry) GetDownload() *Download

func (*LogEntry) GetFilesystemOperation

func (x *LogEntry) GetFilesystemOperation() *FilesystemOp

func (*LogEntry) GetHoneypotEvent

func (x *LogEntry) GetHoneypotEvent() *HoneypotEvent

func (*LogEntry) GetInvalidInvocation

func (x *LogEntry) GetInvalidInvocation() *InvalidInvocation

func (*LogEntry) GetLogType

func (m *LogEntry) GetLogType() isLogEntry_LogType

func (*LogEntry) GetLoginAttempt

func (x *LogEntry) GetLoginAttempt() *LoginAttempt

func (*LogEntry) GetOpenFile

func (x *LogEntry) GetOpenFile() *OpenFile

func (*LogEntry) GetOpenTtyLog

func (x *LogEntry) GetOpenTtyLog() *OpenTTYLog

func (*LogEntry) GetPanic

func (x *LogEntry) GetPanic() *Panic

func (*LogEntry) GetRunCommand

func (x *LogEntry) GetRunCommand() *RunCommand

func (*LogEntry) GetSessionId

func (x *LogEntry) GetSessionId() string

func (*LogEntry) GetTerminalUpdate

func (x *LogEntry) GetTerminalUpdate() *TerminalUpdate

func (*LogEntry) GetTimestampMicros

func (x *LogEntry) GetTimestampMicros() int64

func (*LogEntry) GetUnknownCommand

func (x *LogEntry) GetUnknownCommand() *UnknownCommand

func (*LogEntry) GetUsedCredentials

func (x *LogEntry) GetUsedCredentials() *Credentials

func (*LogEntry) MarshalJSON

func (msg *LogEntry) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*LogEntry) ProtoMessage

func (*LogEntry) ProtoMessage()

func (*LogEntry) ProtoReflect

func (x *LogEntry) ProtoReflect() protoreflect.Message

func (*LogEntry) Reset

func (x *LogEntry) Reset()

func (*LogEntry) String

func (x *LogEntry) String() string

func (*LogEntry) UnmarshalJSON

func (msg *LogEntry) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type LogEntry_ConnectionLost

type LogEntry_ConnectionLost struct {
	ConnectionLost *ConnectionLost `protobuf:"bytes,18,opt,name=connection_lost,json=connectionLost,proto3,oneof"`
}

type LogEntry_Download

type LogEntry_Download struct {
	Download *Download `protobuf:"bytes,25,opt,name=download,proto3,oneof"`
}

type LogEntry_FilesystemOperation

type LogEntry_FilesystemOperation struct {
	FilesystemOperation *FilesystemOp `protobuf:"bytes,16,opt,name=filesystem_operation,json=filesystemOperation,proto3,oneof"`
}

type LogEntry_HoneypotEvent

type LogEntry_HoneypotEvent struct {
	HoneypotEvent *HoneypotEvent `protobuf:"bytes,27,opt,name=honeypot_event,json=honeypotEvent,proto3,oneof"`
}

type LogEntry_InvalidInvocation

type LogEntry_InvalidInvocation struct {
	InvalidInvocation *InvalidInvocation `protobuf:"bytes,23,opt,name=invalid_invocation,json=invalidInvocation,proto3,oneof"`
}

type LogEntry_LoginAttempt

type LogEntry_LoginAttempt struct {
	// An attempt to log in to the honeypot.
	LoginAttempt *LoginAttempt `protobuf:"bytes,15,opt,name=login_attempt,json=loginAttempt,proto3,oneof"` // ID < 16 for fast proto decoding.
}

type LogEntry_OpenFile

type LogEntry_OpenFile struct {
	OpenFile *OpenFile `protobuf:"bytes,22,opt,name=open_file,json=openFile,proto3,oneof"`
}

type LogEntry_OpenTtyLog

type LogEntry_OpenTtyLog struct {
	OpenTtyLog *OpenTTYLog `protobuf:"bytes,17,opt,name=open_tty_log,json=openTtyLog,proto3,oneof"`
}

type LogEntry_Panic

type LogEntry_Panic struct {
	Panic *Panic `protobuf:"bytes,26,opt,name=panic,proto3,oneof"`
}

type LogEntry_RunCommand

type LogEntry_RunCommand struct {
	RunCommand *RunCommand `protobuf:"bytes,19,opt,name=run_command,json=runCommand,proto3,oneof"`
}

type LogEntry_TerminalUpdate

type LogEntry_TerminalUpdate struct {
	TerminalUpdate *TerminalUpdate `protobuf:"bytes,21,opt,name=terminal_update,json=terminalUpdate,proto3,oneof"`
}

type LogEntry_UnknownCommand

type LogEntry_UnknownCommand struct {
	UnknownCommand *UnknownCommand `protobuf:"bytes,20,opt,name=unknown_command,json=unknownCommand,proto3,oneof"`
}

type LogEntry_UsedCredentials

type LogEntry_UsedCredentials struct {
	UsedCredentials *Credentials `protobuf:"bytes,24,opt,name=used_credentials,json=usedCredentials,proto3,oneof"`
}

type LogRecorder

type LogRecorder func(le *LogEntry) error

LogRecorder is a callback that stores events in an external datastore.

type LogType

type LogType = isLogEntry_LogType

type Logger

type Logger struct {
	Record LogRecorder
}

Logger captures interaction event logs for the honeypot to determine its performance.

func NewJsonLinesLogRecorder

func NewJsonLinesLogRecorder(w io.Writer) *Logger

NewJsonLinesLogRecorder creates a Logger that exports logs in newline delimited JSON object format.

func (*Logger) NewSession

func (l *Logger) NewSession(sessionID string) *SessionLogger

NewSession creates a logger with attached session ID.

func (*Logger) Sessionless

func (l *Logger) Sessionless() *SessionLogger

NewSession creates a logger with attached session ID.

type LoginAttempt

type LoginAttempt struct {

	// The result of the login attempt.
	Result OperationResult `protobuf:"varint,1,opt,name=result,proto3,enum=OperationResult" json:"result,omitempty"`
	// The username the login attempted to use.
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// Public key of the login attempt in SSH wire format
	PublicKey []byte `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	// Password used in the login attempt.
	Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	// Remote address of the machine.
	RemoteAddr string `protobuf:"bytes,5,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"`
	// Environment variables in key=value format.
	EnvironmentVariables []string `protobuf:"bytes,6,rep,name=environment_variables,json=environmentVariables,proto3" json:"environment_variables,omitempty"`
	// Shell parsed command string.
	Command []string `protobuf:"bytes,7,rep,name=command,proto3" json:"command,omitempty"`
	// Raw command string as passed to SSH.
	RawCommand string `protobuf:"bytes,8,opt,name=raw_command,json=rawCommand,proto3" json:"raw_command,omitempty"`
	// The SSH subsystem requested.
	Subsystem string `protobuf:"bytes,9,opt,name=subsystem,proto3" json:"subsystem,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginAttempt) Descriptor deprecated

func (*LoginAttempt) Descriptor() ([]byte, []int)

Deprecated: Use LoginAttempt.ProtoReflect.Descriptor instead.

func (*LoginAttempt) GetCommand

func (x *LoginAttempt) GetCommand() []string

func (*LoginAttempt) GetEnvironmentVariables

func (x *LoginAttempt) GetEnvironmentVariables() []string

func (*LoginAttempt) GetPassword

func (x *LoginAttempt) GetPassword() string

func (*LoginAttempt) GetPublicKey

func (x *LoginAttempt) GetPublicKey() []byte

func (*LoginAttempt) GetRawCommand

func (x *LoginAttempt) GetRawCommand() string

func (*LoginAttempt) GetRemoteAddr

func (x *LoginAttempt) GetRemoteAddr() string

func (*LoginAttempt) GetResult

func (x *LoginAttempt) GetResult() OperationResult

func (*LoginAttempt) GetSubsystem

func (x *LoginAttempt) GetSubsystem() string

func (*LoginAttempt) GetUsername

func (x *LoginAttempt) GetUsername() string

func (*LoginAttempt) MarshalJSON

func (msg *LoginAttempt) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*LoginAttempt) ProtoMessage

func (*LoginAttempt) ProtoMessage()

func (*LoginAttempt) ProtoReflect

func (x *LoginAttempt) ProtoReflect() protoreflect.Message

func (*LoginAttempt) Reset

func (x *LoginAttempt) Reset()

func (*LoginAttempt) String

func (x *LoginAttempt) String() string

func (*LoginAttempt) UnmarshalJSON

func (msg *LoginAttempt) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type LoginAttemptReport

type LoginAttemptReport struct {
	// List of passwords and their counts.
	Passwords StrCounter `json:"passwords"`
	// List of usernames and their counts.
	Usernames StrCounter `json:"usernames"`
	// List of login attempt results and their counts.
	Results StrCounter `json:"results"`
}

type OpenFile

type OpenFile struct {

	// Path of the file that was opened.
	Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*OpenFile) Descriptor deprecated

func (*OpenFile) Descriptor() ([]byte, []int)

Deprecated: Use OpenFile.ProtoReflect.Descriptor instead.

func (*OpenFile) GetPath

func (x *OpenFile) GetPath() string

func (*OpenFile) MarshalJSON

func (msg *OpenFile) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*OpenFile) ProtoMessage

func (*OpenFile) ProtoMessage()

func (*OpenFile) ProtoReflect

func (x *OpenFile) ProtoReflect() protoreflect.Message

func (*OpenFile) Reset

func (x *OpenFile) Reset()

func (*OpenFile) String

func (x *OpenFile) String() string

func (*OpenFile) UnmarshalJSON

func (msg *OpenFile) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type OpenTTYLog

type OpenTTYLog struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*OpenTTYLog) Descriptor deprecated

func (*OpenTTYLog) Descriptor() ([]byte, []int)

Deprecated: Use OpenTTYLog.ProtoReflect.Descriptor instead.

func (*OpenTTYLog) GetName

func (x *OpenTTYLog) GetName() string

func (*OpenTTYLog) MarshalJSON

func (msg *OpenTTYLog) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*OpenTTYLog) ProtoMessage

func (*OpenTTYLog) ProtoMessage()

func (*OpenTTYLog) ProtoReflect

func (x *OpenTTYLog) ProtoReflect() protoreflect.Message

func (*OpenTTYLog) Reset

func (x *OpenTTYLog) Reset()

func (*OpenTTYLog) String

func (x *OpenTTYLog) String() string

func (*OpenTTYLog) UnmarshalJSON

func (msg *OpenTTYLog) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type OperationResult

type OperationResult int32
const (
	OperationResult_UNKNOWN OperationResult = 0
	OperationResult_SUCCESS OperationResult = 1
	OperationResult_FAILURE OperationResult = 2
)

func (OperationResult) Descriptor

func (OperationResult) Enum

func (x OperationResult) Enum() *OperationResult

func (OperationResult) EnumDescriptor deprecated

func (OperationResult) EnumDescriptor() ([]byte, []int)

Deprecated: Use OperationResult.Descriptor instead.

func (OperationResult) Number

func (OperationResult) String

func (x OperationResult) String() string

func (OperationResult) Type

type Panic

type Panic struct {

	// Context about what was going on before the panic.
	Context string `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"`
	// Stacktrace of the panic.
	Stacktrace string `protobuf:"bytes,2,opt,name=stacktrace,proto3" json:"stacktrace,omitempty"`
	// contains filtered or unexported fields
}

Information about a panic.

func (*Panic) Descriptor deprecated

func (*Panic) Descriptor() ([]byte, []int)

Deprecated: Use Panic.ProtoReflect.Descriptor instead.

func (*Panic) GetContext

func (x *Panic) GetContext() string

func (*Panic) GetStacktrace

func (x *Panic) GetStacktrace() string

func (*Panic) MarshalJSON

func (msg *Panic) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Panic) ProtoMessage

func (*Panic) ProtoMessage()

func (*Panic) ProtoReflect

func (x *Panic) ProtoReflect() protoreflect.Message

func (*Panic) Reset

func (x *Panic) Reset()

func (*Panic) String

func (x *Panic) String() string

func (*Panic) UnmarshalJSON

func (msg *Panic) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type PanicReport

type PanicReport struct {
	Contexts []string `json:"contexts"`
}

type PathCounter

type PathCounter struct {
	// contains filtered or unexported fields
}

PathCounter counts the number of strings seen.

func NewPathCounter

func NewPathCounter(cols ...string) *PathCounter

func (*PathCounter) Increment

func (ctr *PathCounter) Increment(toAdd ...string)

Increment adds one to the given key.

func (*PathCounter) MarshalJSON

func (ctr *PathCounter) MarshalJSON() ([]byte, error)

MarshalJSON implemnts custom JSON marshaler.

type Report

type Report struct {
	LogEntries     int        `json:"log_entries"`
	InvalidEntries StrCounter `json:"unknown_log_entries,omitempty"`

	LoginAttempt      LoginAttemptReport      `json:"login_attempt_report"`
	RunCommand        RunCommandReport        `json:"run_command_report"`
	UnknownCommand    UnknownCommandReport    `json:"unknown_command_report"`
	InvalidInvocation InvalidInvocationReport `json:"invalid_invocation_report"`
	Credentials       CredentialsReport       `json:"credential_report"`
	Download          DownloadReport          `json:"download_report"`
	Panic             PanicReport             `json:"panic_report"`
}

Report holds statistics about the logged events.

func (*Report) Update

func (r *Report) Update(le *LogEntry)

type RunCommand

type RunCommand struct {

	// Shell parsed command string.
	Command []string `protobuf:"bytes,1,rep,name=command,proto3" json:"command,omitempty"`
	// Environment variables in key=value format.
	EnvironmentVariables []string `protobuf:"bytes,2,rep,name=environment_variables,json=environmentVariables,proto3" json:"environment_variables,omitempty"`
	// Path to the resolved command.
	ResolvedCommandPath string `protobuf:"bytes,4,opt,name=resolved_command_path,json=resolvedCommandPath,proto3" json:"resolved_command_path,omitempty"`
	// contains filtered or unexported fields
}

func (*RunCommand) Descriptor deprecated

func (*RunCommand) Descriptor() ([]byte, []int)

Deprecated: Use RunCommand.ProtoReflect.Descriptor instead.

func (*RunCommand) GetCommand

func (x *RunCommand) GetCommand() []string

func (*RunCommand) GetEnvironmentVariables

func (x *RunCommand) GetEnvironmentVariables() []string

func (*RunCommand) GetResolvedCommandPath

func (x *RunCommand) GetResolvedCommandPath() string

func (*RunCommand) MarshalJSON

func (msg *RunCommand) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*RunCommand) ProtoMessage

func (*RunCommand) ProtoMessage()

func (*RunCommand) ProtoReflect

func (x *RunCommand) ProtoReflect() protoreflect.Message

func (*RunCommand) Reset

func (x *RunCommand) Reset()

func (*RunCommand) String

func (x *RunCommand) String() string

func (*RunCommand) UnmarshalJSON

func (msg *RunCommand) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type RunCommandReport

type RunCommandReport struct {
	// Name of the resolved command
	ResolvedCommandPaths StrCounter `json:"resolved_command_names"`
	// Name of the command
	CommandNames StrCounter `json:"command_names"`
}

type SessionLogger

type SessionLogger struct {
	*Logger
	// contains filtered or unexported fields
}

SessionLogger logs messages with a shared session ID.

func (*SessionLogger) Record

func (l *SessionLogger) Record(event LogType) error

func (*SessionLogger) SessionID

func (l *SessionLogger) SessionID() string

type StrCounter

type StrCounter struct {
	// contains filtered or unexported fields
}

StrCounter counts the number of strings seen.

func (*StrCounter) Increment

func (s *StrCounter) Increment(toAdd string)

Increment adds one to the given key.

func (StrCounter) MarshalJSON

func (s StrCounter) MarshalJSON() ([]byte, error)

MarshalJSON implemnts custom JSON marshaler.

type TerminalUpdate

type TerminalUpdate struct {

	// Width of the terminal in characters.
	Width int32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"`
	// Height of the terminal in charactres.
	Height int32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	// Name of the connected terminal.
	Term string `protobuf:"bytes,3,opt,name=term,proto3" json:"term,omitempty"`
	// Whether the terminal is a PTY.
	IsPty bool `protobuf:"varint,4,opt,name=is_pty,json=isPty,proto3" json:"is_pty,omitempty"`
	// contains filtered or unexported fields
}

func (*TerminalUpdate) Descriptor deprecated

func (*TerminalUpdate) Descriptor() ([]byte, []int)

Deprecated: Use TerminalUpdate.ProtoReflect.Descriptor instead.

func (*TerminalUpdate) GetHeight

func (x *TerminalUpdate) GetHeight() int32

func (*TerminalUpdate) GetIsPty

func (x *TerminalUpdate) GetIsPty() bool

func (*TerminalUpdate) GetTerm

func (x *TerminalUpdate) GetTerm() string

func (*TerminalUpdate) GetWidth

func (x *TerminalUpdate) GetWidth() int32

func (*TerminalUpdate) MarshalJSON

func (msg *TerminalUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*TerminalUpdate) ProtoMessage

func (*TerminalUpdate) ProtoMessage()

func (*TerminalUpdate) ProtoReflect

func (x *TerminalUpdate) ProtoReflect() protoreflect.Message

func (*TerminalUpdate) Reset

func (x *TerminalUpdate) Reset()

func (*TerminalUpdate) String

func (x *TerminalUpdate) String() string

func (*TerminalUpdate) UnmarshalJSON

func (msg *TerminalUpdate) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type UnknownCommand

type UnknownCommand struct {

	// Shell parsed command string.
	Command []string `protobuf:"bytes,1,rep,name=command,proto3" json:"command,omitempty"`
	// The reason the command was unknown.
	Status UnknownCommand_UnknownCommandStatus `protobuf:"varint,2,opt,name=status,proto3,enum=UnknownCommand_UnknownCommandStatus" json:"status,omitempty"`
	// Any associated error message.
	ErrorMessage string `protobuf:"bytes,3,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
	// contains filtered or unexported fields
}

func (*UnknownCommand) Descriptor deprecated

func (*UnknownCommand) Descriptor() ([]byte, []int)

Deprecated: Use UnknownCommand.ProtoReflect.Descriptor instead.

func (*UnknownCommand) GetCommand

func (x *UnknownCommand) GetCommand() []string

func (*UnknownCommand) GetErrorMessage

func (x *UnknownCommand) GetErrorMessage() string

func (*UnknownCommand) GetStatus

func (*UnknownCommand) MarshalJSON

func (msg *UnknownCommand) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*UnknownCommand) ProtoMessage

func (*UnknownCommand) ProtoMessage()

func (*UnknownCommand) ProtoReflect

func (x *UnknownCommand) ProtoReflect() protoreflect.Message

func (*UnknownCommand) Reset

func (x *UnknownCommand) Reset()

func (*UnknownCommand) String

func (x *UnknownCommand) String() string

func (*UnknownCommand) UnmarshalJSON

func (msg *UnknownCommand) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler

type UnknownCommandReport

type UnknownCommandReport struct {
	CommandNames    StrCounter `json:"command_names"`
	CommandStatuses StrCounter `json:"command_statuses"`
}

type UnknownCommand_UnknownCommandStatus

type UnknownCommand_UnknownCommandStatus int32
const (
	UnknownCommand_UNKNOWN         UnknownCommand_UnknownCommandStatus = 0
	UnknownCommand_NOT_FOUND       UnknownCommand_UnknownCommandStatus = 1 // Not found in $PATH.
	UnknownCommand_NOT_IMPLEMENTED UnknownCommand_UnknownCommandStatus = 2 // Executable found, but not implemented.
	UnknownCommand_LOOKUP_ERROR    UnknownCommand_UnknownCommandStatus = 3 // Error looking up the command..
)

func (UnknownCommand_UnknownCommandStatus) Descriptor

func (UnknownCommand_UnknownCommandStatus) Enum

func (UnknownCommand_UnknownCommandStatus) EnumDescriptor deprecated

func (UnknownCommand_UnknownCommandStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use UnknownCommand_UnknownCommandStatus.Descriptor instead.

func (UnknownCommand_UnknownCommandStatus) Number

func (UnknownCommand_UnknownCommandStatus) String

func (UnknownCommand_UnknownCommandStatus) Type

Jump to

Keyboard shortcuts

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