Documentation
¶
Index ¶
- Constants
- Variables
- func GetEventCategory(eventType string) string
- func GetEventSeverity(eventType string) string
- func RegisterShutdown(lc fx.Lifecycle, service *Service)
- type AuditEvent
- type Service
- func (s *Service) Close() error
- func (s *Service) IsEnabled() bool
- func (s *Service) Log(event AuditEvent)
- func (s *Service) LogAuthEvent(eventType string, clientIP string, success bool, failureReason string)
- func (s *Service) LogFileEvent(eventType string, clientIP string, stackName string, targetPath string, ...)
- func (s *Service) LogMaintenanceEvent(eventType string, clientIP string, success bool, failureReason string, ...)
- func (s *Service) LogOperationEvent(eventType string, clientIP string, stackName string, operationID string, ...)
- func (s *Service) LogStackEvent(eventType string, clientIP string, stackName string, success bool, ...)
- func (s *Service) LogTerminalEvent(eventType string, clientIP string, stackName string, containerName string, ...)
- func (s *Service) LogVulnscanEvent(eventType string, clientIP string, stackName string, success bool, ...)
Constants ¶
View Source
const ( EventFileRead = "file.read" EventFileWrite = "file.write" EventFileDelete = "file.delete" EventFileRename = "file.rename" EventFileCopy = "file.copy" EventFileChmod = "file.chmod" EventFileChown = "file.chown" EventFileMkdir = "file.mkdir" EventFileUpload = "file.upload" EventFileDownload = "file.download" EventFileListDir = "file.listdir" EventFileDirStats = "file.dirstats" )
View Source
const ( EventStackList = "stack.list" EventStackCreate = "stack.create" EventStackGetDetails = "stack.get_details" EventStackGetSummary = "stack.get_summary" EventStackGetEnvVars = "stack.get_env_vars" EventStackGetNetworks = "stack.get_networks" EventStackGetVolumes = "stack.get_volumes" EventStackGetImages = "stack.get_images" EventStackGetCompose = "stack.get_compose" EventStackUpdateCompose = "stack.update_compose" )
View Source
const ( EventOperationStarted = "operation.started" EventOperationCompleted = "operation.completed" EventOperationFailed = "operation.failed" EventOperationStreamed = "operation.streamed" )
View Source
const ( EventMaintenanceGetInfo = "maintenance.get_info" EventMaintenancePrune = "maintenance.prune" EventMaintenanceDeleteResource = "maintenance.delete_resource" )
View Source
const ( EventContainerLogs = "container.logs" EventContainerStats = "container.stats" EventImageCheckUpdates = "image.check_updates" )
View Source
const ( EventVulnscanStarted = "vulnscan.started" EventVulnscanCompleted = "vulnscan.completed" EventVulnscanRetrieved = "vulnscan.retrieved" EventVulnscanStatus = "vulnscan.status" )
View Source
const ( EventTerminalConnected = "terminal.connected" EventTerminalDisconnected = "terminal.disconnected" )
View Source
const ( EventAuthSuccess = "auth.success" EventAuthFailure = "auth.failure" )
Variables ¶
View Source
var Module = fx.Options( fx.Provide(NewServiceFromConfig), fx.Invoke(RegisterShutdown), )
Functions ¶
func GetEventCategory ¶
func GetEventSeverity ¶
func RegisterShutdown ¶
Types ¶
type AuditEvent ¶
type AuditEvent struct {
Timestamp time.Time `json:"timestamp"`
EventType string `json:"event_type"`
EventCategory string `json:"event_category"`
Severity string `json:"severity"`
Success bool `json:"success"`
ClientIP string `json:"client_ip,omitempty"`
StackName string `json:"stack_name,omitempty"`
TargetPath string `json:"target_path,omitempty"`
OperationID string `json:"operation_id,omitempty"`
Command string `json:"command,omitempty"`
FailureReason string `json:"failure_reason,omitempty"`
DurationMs int64 `json:"duration_ms,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) Log ¶
func (s *Service) Log(event AuditEvent)
func (*Service) LogAuthEvent ¶
func (*Service) LogFileEvent ¶
func (*Service) LogMaintenanceEvent ¶
func (*Service) LogOperationEvent ¶
func (*Service) LogStackEvent ¶
func (*Service) LogTerminalEvent ¶
Click to show internal directories.
Click to hide internal directories.