Documentation
¶
Overview ¶
Package audit records auditable events
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditEntry ¶
type AuditEntry struct {
// JujuServerVersion is the version of the jujud that recorded
// this AuditEntry.
JujuServerVersion version.Number
// ModelUUID is the ID of the model the audit entry was written
// on.
ModelUUID string
// Timestamp is when the audit entry was generated. It must be
// stored with the UTC locale.
Timestamp time.Time
// RemoteAddress is the IP of the machine from which the
// audit-event was triggered.
RemoteAddress string
// OriginType is the type of entity (e.g. model, user, action)
// which triggered the audit event.
OriginType string
// OriginName is the name of the origin which triggered the
// audit-event.
OriginName string
// Operation is the operation that was performed that triggered
// the audit event.
Operation string
// Data is a catch-all for storing random data.
Data map[string]interface{}
}
AuditEntry represents an auditted event.
func (AuditEntry) Validate ¶
func (e AuditEntry) Validate() error
Validate ensures that the entry considers itself to be in a complete and valid state.
type AuditEntrySinkFn ¶
type AuditEntrySinkFn func(AuditEntry) error
AuditEntrySinkFn defines a function which will send an AuditEntry to a backing store and return an error upon failure.
func NewLogFileSink ¶
func NewLogFileSink(logDir string) AuditEntrySinkFn
NewLogFileSink returns an audit entry sink which writes to an audit.log file in the specified directory.
Click to show internal directories.
Click to hide internal directories.