models

package
v0.0.0-...-2bab0af Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonAttributes

type CommonAttributes struct {
	Timestamp time.Time
	ProcessId uint32
	UserName  string
	Type      string
}

type FileMod

type FileMod struct {
	Common   CommonAttributes
	Action   FileModActionType
	FilePath string
	FileName string
	FileMd5  string
}

func GenerateFileMod

func GenerateFileMod(pid uint32, userName string) *FileMod

func (*FileMod) Format

func (f *FileMod) Format() string

func (*FileMod) MachineName

func (f *FileMod) MachineName() string

func (*FileMod) ProcessId

func (f *FileMod) ProcessId() uint32

func (*FileMod) SetTimestamp

func (f *FileMod) SetTimestamp(ts time.Time)

func (*FileMod) Timestamp

func (f *FileMod) Timestamp() time.Time

func (*FileMod) Type

func (f *FileMod) Type() string

func (*FileMod) UserName

func (f *FileMod) UserName() string

type FileModActionType

type FileModActionType uint8
const (
	FileOpen FileModActionType = iota
	FileRead
	FileWrite
	FileTruncate
	FileClose
	FileRename
	FileDelete
)

type Model

type Model interface {
	// Getters
	Type() string
	Timestamp() time.Time
	ProcessId() uint32
	UserName() string
	MachineName() string
	Format() string

	// Setters
	SetTimestamp(ts time.Time)
}

type Models

type Models []Model

func (Models) AsJson

func (m Models) AsJson() []byte

Helpers

func (Models) Len

func (m Models) Len() int

Implement sort.Interface

func (Models) Less

func (m Models) Less(i, j int) bool

func (Models) Print

func (m Models) Print()

func (Models) Swap

func (m Models) Swap(i, j int)

type NetConn

type NetConn struct {
	Common        CommonAttributes
	LocalAddress  string
	LocalPort     uint16
	RemoteAddress string
	RemotePort    uint16
	DomainName    string
	ProtocolType  Protocol
	Direction     NetConnDirection
}

func GenerateNetConn

func GenerateNetConn(pid uint32, userName string) *NetConn

func (*NetConn) Format

func (n *NetConn) Format() string

func (*NetConn) MachineName

func (n *NetConn) MachineName() string

func (*NetConn) ProcessId

func (n *NetConn) ProcessId() uint32

func (*NetConn) SetTimestamp

func (n *NetConn) SetTimestamp(ts time.Time)

func (*NetConn) Timestamp

func (n *NetConn) Timestamp() time.Time

func (*NetConn) Type

func (n *NetConn) Type() string

func (*NetConn) UserName

func (n *NetConn) UserName() string

type NetConnDirection

type NetConnDirection uint8
const (
	NetConnDirOutgoing NetConnDirection = iota
	NetConnDirIncoming
)

type ProcessEnd

type ProcessEnd struct {
	Common CommonAttributes
}

func GenerateProcessEnd

func GenerateProcessEnd(pid uint32, userName string) *ProcessEnd

func (*ProcessEnd) Format

func (p *ProcessEnd) Format() string

func (*ProcessEnd) MachineName

func (p *ProcessEnd) MachineName() string

func (*ProcessEnd) ProcessId

func (p *ProcessEnd) ProcessId() uint32

func (*ProcessEnd) SetTimestamp

func (p *ProcessEnd) SetTimestamp(ts time.Time)

func (*ProcessEnd) Timestamp

func (p *ProcessEnd) Timestamp() time.Time

func (*ProcessEnd) Type

func (p *ProcessEnd) Type() string

func (*ProcessEnd) UserName

func (p *ProcessEnd) UserName() string

type ProcessExec

type ProcessExec struct {
	Common         CommonAttributes
	NewProcessName string
	NewProcessPath string
	NewCommandLine []string
}

func GenerateProcessExec

func GenerateProcessExec(pid uint32, userName string) *ProcessExec

func (*ProcessExec) Format

func (p *ProcessExec) Format() string

func (*ProcessExec) MachineName

func (p *ProcessExec) MachineName() string

func (*ProcessExec) ProcessId

func (p *ProcessExec) ProcessId() uint32

func (*ProcessExec) SetTimestamp

func (p *ProcessExec) SetTimestamp(ts time.Time)

func (*ProcessExec) Timestamp

func (p *ProcessExec) Timestamp() time.Time

func (*ProcessExec) Type

func (p *ProcessExec) Type() string

func (*ProcessExec) UserName

func (p *ProcessExec) UserName() string

type ProcessFork

type ProcessFork struct {
	Common          CommonAttributes
	ParentProcessId uint32
	ProcessName     string
	ProcessPath     string
	CommandLine     []string
}

func GenerateProcessFork

func GenerateProcessFork(pid uint32, ppid uint32, userName string) *ProcessFork

func (*ProcessFork) Format

func (p *ProcessFork) Format() string

func (*ProcessFork) MachineName

func (p *ProcessFork) MachineName() string

func (*ProcessFork) ProcessId

func (p *ProcessFork) ProcessId() uint32

func (*ProcessFork) SetTimestamp

func (p *ProcessFork) SetTimestamp(ts time.Time)

func (*ProcessFork) Timestamp

func (p *ProcessFork) Timestamp() time.Time

func (*ProcessFork) Type

func (p *ProcessFork) Type() string

func (*ProcessFork) UserName

func (p *ProcessFork) UserName() string

type Protocol

type Protocol uint8
const (
	ProtocolTcp Protocol = iota
	ProtocolUdp
	ProtocolIcmp
)

Jump to

Keyboard shortcuts

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