Documentation
¶
Index ¶
- Constants
- type Logger
- func (l *Logger) Debug(message string, args ...any)
- func (l *Logger) Debugf(message string, args ...any)
- func (l *Logger) Error(err error, args ...any)
- func (l *Logger) Errorf(message string, args ...any)
- func (l *Logger) Fatal(message string, args ...any)
- func (l *Logger) FatalError(err error)
- func (l *Logger) Fatalf(message string, args ...any)
- func (l *Logger) Info(message string, args ...any)
- func (l *Logger) Infof(message string, args ...any)
- func (l *Logger) MaybeError(err error, args ...any)
- func (l *Logger) Security(issue SecurityLogEntry)
- func (l *Logger) Warn(message string, args ...any)
- func (l *Logger) Warnf(message string, args ...any)
- type SecurityLogEntry
Constants ¶
View Source
const ( LevelTrace = slog.Level(-8) LevelFatal = slog.Level(12) LevelSecurity = slog.Level(16) SeverityLow = "Low" SeverityMedium = "Medium" SeverityHigh = "High" SeverityCritical = "Critical" CategoryAccessControl = "Access Control" CategoryAuthentication = "Authentication" CategoryAuthorization = "Authorization" CategoryDataBreach = "Data Breach" CategoryMalwareDetection = "Malware Detection" CategoryNetworkSecurity = "Network Security" CategoryPolicyViolation = "Policy Violation" CategorySystemIntegrity = "System Integrity" CategoryUserBehavior = "User Behavior" SourceAccessControl = "access_control" SourceAuthentication = "authentication" SourceDNS = "dns" SourceNetwork = "network" SourceSystem = "system" SourceUserActivity = "user_activity" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func DefaultLogger ¶
func DefaultLogger() *Logger
func (*Logger) FatalError ¶
func (*Logger) MaybeError ¶
func (*Logger) Security ¶
func (l *Logger) Security(issue SecurityLogEntry)
Logs a security issue with standardized fields to faciliate processing security issues by external systems.
type SecurityLogEntry ¶
type SecurityLogEntry struct { Timestamp time.Time `json:"timestamp"` Severity string `json:"severity"` Category string `json:"category"` Description string `json:"description"` Details string `json:"details,omitempty"` Source string `json:"source,omitempty"` OffenderAddress string `json:"offender_address,omitempty"` OffenderID string `json:"offender_id,omitempty"` }
SecurityLogEntry defines the structure of a security log entry.
Click to show internal directories.
Click to hide internal directories.