audit

package
v0.0.0-...-4bd6544 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 11 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL