Documentation
¶
Index ¶
- type Event
- type EventType
- type Logger
- func (l *Logger) Log(_ context.Context, event Event)
- func (l *Logger) LogAdminOp(ctx context.Context, actor, action, resource, detail string)
- func (l *Logger) LogAuth(ctx context.Context, actor, sourceIP string, success bool, detail string)
- func (l *Logger) LogComponentOp(ctx context.Context, actor, action, componentID, detail string, success bool)
- func (l *Logger) LogConfigChange(ctx context.Context, actor, resource, detail string)
- func (l *Logger) LogDataAccess(ctx context.Context, actor, resource, detail string)
- func (l *Logger) LogEscalation(ctx context.Context, actor, action, detail string, success bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Timestamp time.Time `json:"timestamp"`
Type EventType `json:"type"`
Action string `json:"action"`
Actor string `json:"actor,omitempty"`
Resource string `json:"resource,omitempty"`
Detail string `json:"detail,omitempty"`
SourceIP string `json:"source_ip,omitempty"`
Success bool `json:"success"`
Metadata map[string]any `json:"metadata,omitempty"`
}
Event is a single audit log entry.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger records security-relevant audit events as structured JSON.
func NewLogger ¶
NewLogger creates an AuditLogger that writes JSON events to the given writer. If w is nil, it defaults to os.Stdout.
func (*Logger) LogAdminOp ¶
LogAdminOp records an administrative operation.
func (*Logger) LogComponentOp ¶
func (l *Logger) LogComponentOp(ctx context.Context, actor, action, componentID, detail string, success bool)
LogComponentOp records a dynamic component lifecycle operation.
func (*Logger) LogConfigChange ¶
LogConfigChange records a configuration change event.
func (*Logger) LogDataAccess ¶
LogDataAccess records a data access event.
Click to show internal directories.
Click to hide internal directories.