Documentation
¶
Index ¶
- func AuditLevelEncoder(lvl zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
- type AuditConfig
- type AuditLevel
- func (l AuditLevel) CapitalString() string
- func (l AuditLevel) Enabled(_ zapcore.Level) bool
- func (l *AuditLevel) Get() interface{}
- func (l AuditLevel) MarshalText() ([]byte, error)
- func (l *AuditLevel) Set(s string) error
- func (l AuditLevel) String() string
- func (l *AuditLevel) UnmarshalText(text []byte) error
- type AuditLog
- type AuditPayload
- type AuditRecorder
- type AuditRequestData
- type Auditor
- type NoopAuditor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuditLevelEncoder ¶
func AuditLevelEncoder(lvl zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
Types ¶
type AuditConfig ¶
type AuditConfig struct {
HMACKey []byte
}
AuditConfig captures the various config necessary for add audit functionality to a component
type AuditLevel ¶
func (AuditLevel) CapitalString ¶
func (l AuditLevel) CapitalString() string
func (*AuditLevel) Get ¶
func (l *AuditLevel) Get() interface{}
func (AuditLevel) MarshalText ¶
func (l AuditLevel) MarshalText() ([]byte, error)
func (*AuditLevel) Set ¶
func (l *AuditLevel) Set(s string) error
func (AuditLevel) String ¶
func (l AuditLevel) String() string
func (*AuditLevel) UnmarshalText ¶
func (l *AuditLevel) UnmarshalText(text []byte) error
type AuditLog ¶
type AuditLog struct {
Tenant string `json:"tenant"`
Payload AuditPayload `json:"payload"`
Hmac string `json:"hmac"`
}
AuditLog captures the format of the audit event
type AuditPayload ¶
type AuditPayload struct {
Timestamp time.Time `json:"timestamp"`
ParentAuditID string `json:"parentAuditId"`
ID string `json:"id"`
MachineID string `json:"machineId"`
Operation string `json:"operation"`
Type string `json:"type"`
ActorID string `json:"actorId"`
ActorLocation string `json:"actorLocation"`
SubjectID string `json:"subjectId"`
SubjectLocation string `json:"subjectLocation"`
ObjectID string `json:"objectId"`
ObjectLocation string `json:"objectLocation"`
HmacBefore string `json:"hmacBefore"`
HmacAfter string `json:"hmacAfter"`
StateSummary string `json:"stateSummary"`
Summary string `json:"summary"`
State string `json:"state"`
Data AuditRequestData `json:"data"`
}
AuditPayload contains the actual information provided by the component generting the audit event
type AuditRecorder ¶
type AuditRecorder interface {
RecordEvent(*AuditPayload)
}
AuditRecorder describes the functionality that is required to be write/record an audit-event
type AuditRequestData ¶
type AuditRequestData struct {
ErrorMessage string `json:"errorMessage"`
HttpMethod string `json:"httpMethod"`
RequestUri string `json:"requestUri"`
RemoteAddr string `json:"remoteAddr"`
UserAgent string `json:"userAgent"`
HttpStatus int `json:"httpStatus"`
}
AuditRequestData captures the core information about the request generating the audit event
type Auditor ¶
type Auditor interface {
AuditRecorder
}
Auditor captures the various functionality of the any audit provider
func NewLogAuditor ¶
func NewNoopAuditor ¶
func NewNoopAuditor() Auditor
type NoopAuditor ¶
type NoopAuditor struct{}
func (*NoopAuditor) RecordEvent ¶
func (n *NoopAuditor) RecordEvent(_ *AuditPayload)
Click to show internal directories.
Click to hide internal directories.