Documentation
¶
Index ¶
- func LogAlert(filename string, alert Alert) error
- func WriteToFile(filename string, content string) error
- type Alert
- type BatchOperation
- type CachedFileInfo
- type CachedProcessInfo
- type ConnectionInfo
- type DBStats
- type DiffRenderer
- type DiffResult
- type DiffSummary
- type Differ
- type ELFFile
- type EntropyFile
- type FIFOInjection
- type FastDB
- func (fdb *FastDB) BatchWrite(bucket string, key, value []byte) error
- func (fdb *FastDB) Close() error
- func (fdb *FastDB) Compact() error
- func (fdb *FastDB) FastBulkWrite(bucket string, data map[string][]byte) error
- func (fdb *FastDB) FastIterate(bucket string, fn func(key, value []byte) error) error
- func (fdb *FastDB) FastRead(bucket string, key []byte) ([]byte, error)
- func (fdb *FastDB) FastWrite(bucket string, key, value []byte) error
- func (fdb *FastDB) GetStats() DBStats
- func (fdb *FastDB) PreallocateBuckets(buckets []string) error
- type FileDiff
- type FileInfo
- type FilesystemMonitor
- type MountInfo
- type NetworkDiff
- type NetworkInfo
- type NetworkMonitor
- type ProcessDiff
- type ProcessInfo
- type ProcessMonitor
- type Recorder
- type RecordingStats
- type ReplayConfig
- type ReplayInfo
- type ReplayPlayer
- type Rule
- type ScanResults
- type SystemSnapshot
- type TraceConfig
- type Tracer
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteToFile ¶
WriteToFile is a utility function for writing content to files
Types ¶
type Alert ¶
type Alert struct {
ID string `json:"id"`
Timestamp time.Time `json:"timestamp"`
Severity string `json:"severity"`
Title string `json:"title"`
Description string `json:"description"`
RuleName string `json:"rule_name"`
Process *ProcessInfo `json:"process,omitempty"`
Network *NetworkInfo `json:"network,omitempty"`
File *FileInfo `json:"file,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
Alert represents a security alert
type BatchOperation ¶
BatchOperation represents a batched database operation
type CachedFileInfo ¶
type CachedProcessInfo ¶
type ConnectionInfo ¶
type DBStats ¶
type DBStats struct {
Reads int64
Writes int64
BatchWrites int64
Errors int64
AvgReadTime time.Duration
AvgWriteTime time.Duration
CacheHits int64
CacheMisses int64
}
DBStats tracks database performance metrics
type DiffRenderer ¶
type DiffRenderer struct {
// contains filtered or unexported fields
}
DiffRenderer renders diff results in various formats
func NewDiffRenderer ¶
func NewDiffRenderer(format string) *DiffRenderer
NewDiffRenderer creates a new diff renderer
func (*DiffRenderer) Render ¶
func (dr *DiffRenderer) Render(result *DiffResult) (string, error)
Render renders the diff result in the specified format
type DiffResult ¶
type DiffResult struct {
From string `json:"from"`
To string `json:"to"`
ProcessChanges []ProcessDiff `json:"process_changes"`
NetworkChanges []NetworkDiff `json:"network_changes"`
FilesystemChanges []FileDiff `json:"filesystem_changes"`
Summary DiffSummary `json:"summary"`
}
DiffResult contains the result of comparing two snapshots
type DiffSummary ¶
type DiffSummary struct {
ProcessesAdded int `json:"processes_added"`
ProcessesRemoved int `json:"processes_removed"`
ProcessesChanged int `json:"processes_changed"`
NetworkAdded int `json:"network_added"`
NetworkRemoved int `json:"network_removed"`
FilesChanged int `json:"files_changed"`
TotalChanges int `json:"total_changes"`
}
DiffSummary provides high-level diff statistics
type Differ ¶
type Differ struct{}
Differ compares system snapshots
func (*Differ) CompareSnapshots ¶
func (d *Differ) CompareSnapshots(from, to string) (*DiffResult, error)
CompareSnapshots compares two system snapshots
type ELFFile ¶
type ELFFile struct {
Path string `json:"path"`
Modification string `json:"modification"`
Expected string `json:"expected,omitempty"`
Actual string `json:"actual,omitempty"`
}
ELFFile represents a modified ELF binary
type EntropyFile ¶
type EntropyFile struct {
Path string `json:"path"`
Entropy float64 `json:"entropy"`
Size int64 `json:"size"`
}
EntropyFile represents a high-entropy binary file
type FIFOInjection ¶
type FIFOInjection struct {
Path string `json:"path"`
PID int `json:"pid"`
Type string `json:"type"`
}
FIFOInjection represents a FIFO-based injection attack
type FastDB ¶
type FastDB struct {
// contains filtered or unexported fields
}
FastDB provides high-performance database operations
func (*FastDB) BatchWrite ¶
BatchWrite queues a write operation for batching
func (*FastDB) FastBulkWrite ¶
FastBulkWrite performs bulk write operations with optimal batching
func (*FastDB) FastIterate ¶
FastIterate performs high-speed iteration over a bucket
func (*FastDB) PreallocateBuckets ¶
PreallocateBuckets preallocates commonly used buckets for performance
type FileDiff ¶
type FileDiff struct {
Type string `json:"type"`
Path string `json:"path"`
Before *FileInfo `json:"before,omitempty"`
After *FileInfo `json:"after,omitempty"`
}
FileDiff represents changes in filesystem state
type FileInfo ¶
type FileInfo struct {
Path string `json:"path"`
Event string `json:"event"`
PID int `json:"pid"`
Process string `json:"process"`
Timestamp time.Time `json:"timestamp"`
Size int64 `json:"size,omitempty"`
Mode string `json:"mode,omitempty"`
Entropy float64 `json:"entropy,omitempty"`
}
FileInfo contains file system event information
type FilesystemMonitor ¶
type FilesystemMonitor struct {
// contains filtered or unexported fields
}
FilesystemMonitor tracks filesystem changes with ULTRA-HIGH performance
func NewFilesystemMonitor ¶
func NewFilesystemMonitor(db *bbolt.DB) *FilesystemMonitor
NewFilesystemMonitor creates a new ULTRA-HIGH performance filesystem monitor
func (*FilesystemMonitor) GetStats ¶
func (fm *FilesystemMonitor) GetStats() map[string]interface{}
GetStats returns ULTRA-HIGH performance statistics
func (*FilesystemMonitor) Start ¶
func (fm *FilesystemMonitor) Start() error
Start begins filesystem monitoring with ULTRA-HIGH performance
func (*FilesystemMonitor) Stop ¶
func (fm *FilesystemMonitor) Stop()
Stop ends filesystem monitoring
type MountInfo ¶
type MountInfo struct {
Device string `json:"device"`
Path string `json:"path"`
Type string `json:"type"`
Options []string `json:"options"`
Suspicious bool `json:"suspicious,omitempty"`
}
MountInfo contains filesystem mount information
type NetworkDiff ¶
type NetworkDiff struct {
Type string `json:"type"`
Before *NetworkInfo `json:"before,omitempty"`
After *NetworkInfo `json:"after,omitempty"`
}
NetworkDiff represents changes in network state
type NetworkInfo ¶
type NetworkInfo struct {
Protocol string `json:"protocol"`
LocalAddr string `json:"local_addr"`
LocalPort int `json:"local_port"`
RemoteAddr string `json:"remote_addr"`
RemotePort int `json:"remote_port"`
State string `json:"state"`
PID int `json:"pid"`
ProcessName string `json:"process_name"`
}
NetworkInfo contains network connection details
type NetworkMonitor ¶
type NetworkMonitor struct {
// contains filtered or unexported fields
}
NetworkMonitor tracks network connections with ULTRA-HIGH performance
func NewNetworkMonitor ¶
func NewNetworkMonitor(db *bbolt.DB) *NetworkMonitor
NewNetworkMonitor creates a new ULTRA-HIGH performance network monitor
func (*NetworkMonitor) GetStats ¶
func (nm *NetworkMonitor) GetStats() map[string]interface{}
GetStats returns ULTRA-HIGH performance statistics
func (*NetworkMonitor) Start ¶
func (nm *NetworkMonitor) Start() error
Start begins network monitoring with ULTRA-HIGH performance
type ProcessDiff ¶
type ProcessDiff struct {
Type string `json:"type"` // "added", "removed", "modified"
PID int `json:"pid"`
Before *ProcessInfo `json:"before,omitempty"`
After *ProcessInfo `json:"after,omitempty"`
Changes []string `json:"changes,omitempty"`
}
ProcessDiff represents changes in process state
type ProcessInfo ¶
type ProcessInfo struct {
PID int `json:"pid"`
PPID int `json:"ppid"`
Name string `json:"name"`
Cmdline string `json:"cmdline"`
Status string `json:"status"`
CreateTime time.Time `json:"create_time"`
UID int `json:"uid,omitempty"`
GID int `json:"gid,omitempty"`
Memory uint64 `json:"memory,omitempty"`
CPU float64 `json:"cpu,omitempty"`
Threads int `json:"threads,omitempty"`
}
ProcessInfo contains detailed process information
type ProcessMonitor ¶
type ProcessMonitor struct {
// contains filtered or unexported fields
}
ProcessMonitor tracks process lifecycle events with ULTRA-HIGH performance
func NewProcessMonitor ¶
func NewProcessMonitor(db *bbolt.DB, targetPID int) *ProcessMonitor
NewProcessMonitor creates a new ULTRA-HIGH performance process monitor
func (*ProcessMonitor) GetStats ¶
func (pm *ProcessMonitor) GetStats() map[string]interface{}
GetStats returns ULTRA-HIGH performance statistics
func (*ProcessMonitor) Start ¶
func (pm *ProcessMonitor) Start() error
Start begins process monitoring with ULTRA-HIGH performance
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder captures system state snapshots
func NewRecorder ¶
NewRecorder creates a new system state recorder
func (*Recorder) GetSummary ¶
func (r *Recorder) GetSummary() RecordingStats
GetSummary returns recording statistics
func (*Recorder) Initialize ¶
Initialize sets up the recorder database and monitors
type RecordingStats ¶
type RecordingStats struct {
ProcessCount int `json:"process_count"`
NetworkEvents int `json:"network_events"`
FileEvents int `json:"file_events"`
RuleViolations int `json:"rule_violations"`
FileSizeMB float64 `json:"file_size_mb"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
RecordingStats tracks recording metrics
type ReplayConfig ¶
ReplayConfig defines configuration for snapshot replay
type ReplayInfo ¶
type ReplayInfo struct {
Duration time.Duration `json:"duration"`
EventCount int `json:"event_count"`
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
}
ReplayInfo contains metadata about a recording
type ReplayPlayer ¶
type ReplayPlayer struct {
// contains filtered or unexported fields
}
ReplayPlayer replays recorded system snapshots
func NewReplayPlayer ¶
func NewReplayPlayer(filename string) *ReplayPlayer
NewReplayPlayer creates a new replay player
func (*ReplayPlayer) GetInfo ¶
func (rp *ReplayPlayer) GetInfo() ReplayInfo
GetInfo returns information about the loaded recording
func (*ReplayPlayer) Play ¶
func (rp *ReplayPlayer) Play(config ReplayConfig) error
Play starts playback of the recording
type Rule ¶
type Rule struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Severity string `yaml:"severity"`
Type string `yaml:"type"` // process, network, file
Conditions map[string]interface{} `yaml:"conditions"`
}
Rule represents a detection rule
type ScanResults ¶
type ScanResults struct {
HighEntropyFiles []EntropyFile `json:"high_entropy_files"`
ModifiedELFs []ELFFile `json:"modified_elfs"`
SuspiciousMounts []MountInfo `json:"suspicious_mounts"`
FIFOInjections []FIFOInjection `json:"fifo_injections"`
Timestamp time.Time `json:"timestamp"`
ScanPath string `json:"scan_path"`
}
ScanResults contains security scan findings
type SystemSnapshot ¶
type SystemSnapshot struct {
Timestamp time.Time `json:"timestamp"`
Label string `json:"label"`
Processes []ProcessInfo `json:"processes"`
Network []NetworkInfo `json:"network"`
Mounts []MountInfo `json:"mounts"`
}
SystemSnapshot represents a point-in-time system state
type TraceConfig ¶
TraceConfig defines configuration for process tracing
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer provides process and system call tracing capabilities
func (*Tracer) Start ¶
func (t *Tracer) Start(config TraceConfig) error
Start begins tracing the specified process